Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Test Automation Framework with BDD and Cucumber

1,171 views

Published on

This presentation provides an overview of a Test Automation Framework with BDD and Cucumber. It also includes several open-source initiatives that Rhoynar Software Consulting (www.rhoynar.com) has been working on in the fields of QA Automation and DevOps. Lastly, it also includes links to some of the open-source projects that you can use right now for your work.
- Continuous Integration Infra a la OpenStack - https://github.com/Rhoynar/ci-infra
- An Email Verification Library in Java:
https://github.com/Rhoynar/EmailVerify
- Automatic Test Generation using Selenium WebDriver, Java and TestNG
https://github.com/Rhoynar/AutoTestR
- Barebones BDD and Cucumber Framework integrated with Java Maven and TestNG:
https://github.com/Rhoynar/qa-automation

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Test Automation Framework with BDD and Cucumber

  1. 1. BDD and Cucumber based Test Automation Frameworks Harsh Murari harsh@rhoynar.com Software Architect Rhoynar Software Consulting, Boulder, CO www.rhoynar.com Presented At SQUAD Meetup at Denver, CO, Oct 11, 2016
  2. 2. Job Announcements Oct 11, 2016 • Senior PHP Developer: PHP, LAMP, CodeIgnitor,WebStorm • QA Automation Engineer (Boston Area): Java,TestNG, Selenium WebDriver
  3. 3. About Me • Co-founder and Software Architect at Rhoynar Software Consulting (www.rhoynar.com) • Working on Application Development, QA Automation andTest Automation Solutions • 12+ years of Software Engineering Experience
  4. 4. About Rhoynar Software Consulting Founded in 2015, providing QA automation and Continuous Delivery Services for clients in Denver/Boulder area. Contact Us: Web: www.rhoynar.com Ph.: +1-855-5-RHOYNAR Email: contact@rhoynar.com • Consulting: Application Development, QA Automation and DevOps • Staffing: Highly Experienced Candidates • Training: 3-5 days customized training courses
  5. 5. AboutThis Presentation: Objectives • Motivation and Background: • Open-source initiatives from Rhoynar • Continuous Integration Infrastructure • Email NotificationVerification • AutoTestR – Automatic Page Object Generation • BDD and Cucumber • Overview of BDD – Behavior Driven Development Model and Cucumber • Integration of SeleniumWebDriver, Page Objects and Models Design Pattern • BDD andTest Automation Best Practices • BDD Demo
  6. 6. Open Source Initiatives From Rhoynar : https://github.com/Rhoynar
  7. 7. Continuous Integration Infrastructure https://github.com/Rhoynar/ci-infra
  8. 8. CI Infra Workflow https://github.com/Rhoynar/ci-infra
  9. 9. AutoTestR – Page ObjectAuto Generation • AutoTestR uses node.js framework to parse the DOM for the page and generate corresponding test object code. https://github.com/Rhoynar/AutoTestR
  10. 10. AutoTestR Graph BasedTest Case Generation - Each node represents a page-object (or rather business object) - Each node specifies what are its exported interfaces, what are its next states - Based on this graph, AutoTestR auto-generates test case skeletons as well! - ExampleTest Cases: - Login->Unregistered Page - Login->Main Page->CreateUser->End - Login->Main Page->SearchUser->End - Login->Main Page->DeleteUser->End - Login->Main Page->Unregistered Page https://github.com/Rhoynar/AutoTestR
  11. 11. EmailVerify:Verify Email Notification Receipt UseCase - Web Application Sends a Notification/Email to Users - Test Automation Wants toVerify if Email has been received? - Email with certain Subject Line has been received? - Email with certain content has been received? Etc https://github.com/Rhoynar/EmailVerify Use EmailVerify Library - Simple to use: startMonitor(), verify(), stopMonitor() - Multiple variations of use-cases and regular expression parsing support!
  12. 12. BDD/Cucumber based QA- Automation Framework https://github.com/Rhoynar/qa-automation • Project for barebones QA Automation Development Using: • Java • BDD • Cucumber • TestNG • Maven
  13. 13. What is BDD (Behavior Driven Development)? • BDD Keeps Business Behavior in sync with Software Development • ExtendsTest Driven Development to cover BusinessAcceptanceTests
  14. 14. How can I write tests without actual code? • BDD Uses Simple English Syntax (Gherkin) • BDD uses example based ‘Scenarios’ • Each ‘Scenario’ is noted in the form of ’Given’, ‘When’, ‘Then’
  15. 15. Outside In Approach • Start with a conversation • Determine the business value • Provide Examples of use
  16. 16. BDD Example: Simple Login Scenario Step Definitions
  17. 17. Does this only work withWeb Based Applications? • BDD can be work with any type of application! • We recently used BDD to load builds onto Android Device. Scenario: Load Android Build onto device Given Device is Connected When I load the build Then Device is detected in ADB Automatic Conversion to Code public void device_is_connected() {…} public void i_load_the_build() {…} public void device_detected_in_adb() {…}
  18. 18. Building Blocks of Scenarios • BDD Allows to build on top of existing scenarios easily • Existing step-defs can be re-used, only new steps need to be written • Less Code Repetition – better regression framework Scenario: Load Android Build onto device Given Device is Connected When I load the build And I reset the device Then Device is detected in ADB With only one additional step, I have a new test case public void device_is_connected() {…} public void i_load_the_build() {…} public void i_reset_device(){…} public void device_detected_in_adb() {…}
  19. 19. Demo • Yahoo Login Example • Source Code: https://github.com/Rhoynar/qa-automation
  20. 20. Summary • BDD minimizes communications, hides implementation details and provides robust regression tests. • BDD Provides Building blocks of scenarios and step-definitions, so incremental test can be written easily.
  21. 21. Contact Us: Rhoynar Software Consulting Web: www.rhoynar.com Ph.: +1-855-5-RHOYNAR Email: contact@rhoynar.com Consulting QA Automation, DevOps and Application Development Staffing Highly qualified and tech- screened candidates Training Customized onsite training events on latest technologies

×