automated acceptance testing example

17
Automated Acceptance Testing Example HANI MASSOUD 1

Upload: hani-massoud

Post on 27-Nov-2014

66 views

Category:

Technology


0 download

DESCRIPTION

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.

TRANSCRIPT

  • 1. Automated AcceptanceTesting ExampleHANI MASSOUD1

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 results2 3. Contents What are we Testing? How are we Testing? Automated Testing Demo Benefits / Investment3 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 CartBrowserHTML5, CSS3,AngularJSApp ServerDatabase ServerREST Web Services RelationalLift WebApplicationDatabase Page structure Look and feel Presentation logic User Experience REST web services Business logic Persistence logic Persistence Data Model4A web applicationREST 5. What are we testing?5An online storeCategoriesProductsMenu 6. How are we testing?6AutomatedWith a little help fromSelenium and friends 7. How are we testing?73 Steps1. Specify Desired Behaviour 2. Execute Specification 3. Verify Results Online Specs written in Jasminefrom Pivotal Labs Browser automation bySelenium WebDriver andProtractor from Google Unit Test reports by Jasmine Acceptance Test reportsProtractor-html-screenshot-reporterfrom Jintoppy 8. Demo Step 1: Specify Desired Behaviour Step 2: Execute Specification Step 3: Verify Results Online8Specifications are automatedscripts that we can executeSpecs are executed duringdevelopmentTest results are generatedautomaticallyDemo 9. Step 1: Specify Desired Behaviour9Desired behaviour is Specified in aJasmine script developed in theWebStorm JavaScript IDE. WritingJasmine Specifications is beyond thescope of this demo. Follow the Jasminelink to learn more. 10. Step 2: Execute Specification 2.1 Start the System Under Test (SUT) 2.2 Start Selenium WebDriver 2.3 Execute the Specifications10 11. 2.1 Start the System Under Test Go to project directory Run sbt-staging Start up server: container:start11In this step I started the application ina staging environment for testingpurposes. The application must berunning so that Selenium WebDrivercan perform the specified tests in thefollowing steps. 12. 2.2 Start Selenium WebDriver Run webdriver-manager start12After this step, Selenium WebDriver isrunning and ready to execute tests thatwe will run in the next step. 13. 2.3 Execute the Specifications Go to project directory Execute specifications Run the command: protractorsrcmainwebappspece2eConf.js Protractor runs the Specified tests throughSelenium WebDriver13See the video on the next page to seeour automated tests in action. 14. 2.3 Execute the Specifications Go to project directory Execute specifications Run the command: protractorsrcmainwebappspece2eConf.js Protractor will open the browser and run theSpecified tests14 15. 3. Verify the Results Online Open report in browser15After the tests are completed, areport is automatically generatedto show the results.The report is structured byFeature, Story and Scenario as perour Specification.The Specification is livingdocumentation of ourapplication. 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 SeleniumWebDriver can drive Automated Specs need maintenance like any other code base16 17. Thank You Hani Massoud http://au.linkedin.com/in/hanimassoud/17