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.

Automated Acceptance Testing Example


Published on

Heard about Automated Acceptance Testing but not sure what to make of it. Check out this brief intro and demo of an automated acceptance test using Selenium Webdriver, Jasmine and Protractor.

Published in: Technology

Automated Acceptance Testing Example

  1. 1. Automated Acceptance Testing Example HANI MASSOUD 1
  2. 2. Objective  Get a first taste of automated acceptance tests  See some automated tests in action:  An online store with a product catalogue  An automated Specification (how we expect the online store to behave)  Run the Specification  Verify the results 2
  3. 3. Contents  What are we Testing?  How are we Testing?  Automated Testing Demo  Benefits / Investment 3
  4. 4. What are we testing?  System Under Test (SUT)  Web Application: Lift Web Server App, REST Web Services, AngularJS Web Pages  Features: Home Page, Catalogue, Shopping Cart Browser HTML5, CSS3, AngularJS App Server Database Server REST Web Services Relational Lift Web Application Database • Page structure • Look and feel • Presentation logic • User Experience • REST web services • Business logic • Persistence logic • Persistence • Data Model 4 A web application REST
  5. 5. What are we testing? 5 An online store Categories Products Menu
  6. 6. How are we testing? 6 Automated With a little help from Selenium and friends
  7. 7. How are we testing? 7 3 Steps 1. Specify Desired Behaviour 2. Execute Specification 3. Verify Results Online  Specs written in Jasmine from Pivotal Labs  Browser automation by Selenium WebDriver and Protractor from Google  Unit Test reports by Jasmine  Acceptance Test reports Protractor-html-screenshot-reporter from Jintoppy
  8. 8. Demo  Step 1: Specify Desired Behaviour  Step 2: Execute Specification  Step 3: Verify Results Online 8 Specifications are automated scripts that we can execute Specs are executed during development Test results are generated automatically Demo
  9. 9. Step 1: Specify Desired Behaviour 9 Desired behaviour is Specified in a Jasmine script developed in the WebStorm JavaScript IDE. Writing Jasmine Specifications is beyond the scope of this demo. Follow the Jasmine link to learn more.
  10. 10. Step 2: Execute Specification  2.1 Start the System Under Test (SUT)  2.2 Start Selenium WebDriver  2.3 Execute the Specifications 10
  11. 11. 2.1 Start the System Under Test  Go to project directory  Run sbt-staging  Start up server: container:start 11 In this step I started the application in a staging environment for testing purposes. The application must be running so that Selenium WebDriver can perform the specified tests in the following steps.
  12. 12. 2.2 Start Selenium WebDriver  Run webdriver-manager start 12 After this step, Selenium WebDriver is running and ready to execute tests that we will run in the next step.
  13. 13. 2.3 Execute the Specifications  Go to project directory  Execute specifications  Run the command: protractor srcmainwebappspece2eConf.js  Protractor runs the Specified tests through Selenium WebDriver 13 See the video on the next page to see our automated tests in action.
  14. 14. 2.3 Execute the Specifications  Go to project directory  Execute specifications  Run the command: protractor srcmainwebappspece2eConf.js  Protractor will open the browser and run the Specified tests 14
  15. 15. 3. Verify the Results Online  Open report in browser 15 After the tests are completed, a report is automatically generated to show the results. The report is structured by Feature, Story and Scenario as per our Specification. The Specification is “living documentation” of our application.
  16. 16. Benefits / Investment  Specs are living documentation of the system  Specs are reusable for regression tests  Specs create their own test data  System Under Test should provide Web pages or Web services that Selenium WebDriver can drive  Automated Specs need maintenance like any other code base 16
  17. 17. Thank You  Hani Massoud  17