NasdanikaWebTest
November
Modular functional testing
of Web and Mobile Applications
2014 Selenium Web Driver * JUnit *...
Overview
 Functional testing framework built on
 Selenium WebDriver
 JUnit
 OSGi/Equinox
 Implicit screenshot ca...
Report Structure
http://www.nasdanika.org/examples/test-report/#router/main/content/summary.html
Summary, Test Coverage
Actor Coverage
Page Coverage
Page Class Details
Test Class Details
Test Method Details
Slide Show
Opens by clicking on a screenshot in the carousel
Parameterized Test
How It Works
Concepts
 Test Case – A JUnit 4 test case class implementing WebTest interface.
 Test Method – A JUnit test method. Us...
Annotations (partial list)
 Wait – Applies to test/actor/page methods and page classes to wait for certain
conditions (...
Dependencies
 Tests depend on actor/page specifications
 Actor implementations depend on page specifications
 Implem...
Test execution
 Factory injection
 The framework finds actor/page factory OSGi service
 The framework creates a prox...
Page Class
Specification
Implementation fragment
Page Factory
Specification Implementation
Component definition
Actor Class
Specification
Implementation fragment
Actor Factory
Specification Implementation
Page Factory is injected by OSGi
Component definition
Test Class (fragment)
Factory is injected by the framework
Suppressing BEFORE screenshot (blank page)
Parameterized Test (fragment)
Set up workspace(s)
 Install NasdanikaWorkspaceWizard from
http://www.nasdanika.org/server/repository
 Install Maven ...
Value Proposition
 Reuse
 Tests – use with different actor/page implementations.
 Actors/pages – use in different te...
References
 Wiki - https://github.com/Nasdanika/server/wiki/webtest
 Sources -
https://github.com/Nasdanika/server/tr...
of 25

Nasdanika WebTest - Modular functional testing of Web and Mobile Applications

Nasdanika WebTest is a modular framework for automated functional/acceptance testing built on Selenium WebDriver, JUnit and OSGi. The framework implicitly takes screenshots during test execution and generates HTML report with slide shows demonstrating UI flows. Nasdanika WebTest addresses browser/device variability by abstracting tests from UI implementation details with Actor and Page classes, and separating Actor and Page specifications (interfaces) and implementations.
Published on: Mar 3, 2016
Published in: Software      
Source: www.slideshare.net


Transcripts - Nasdanika WebTest - Modular functional testing of Web and Mobile Applications

  • 1. NasdanikaWebTest November Modular functional testing of Web and Mobile Applications 2014 Selenium Web Driver * JUnit * OSGi
  • 2. Overview  Functional testing framework built on  Selenium WebDriver  JUnit  OSGi/Equinox  Implicit screenshot capturing  Report generation with screenshots organized into slide-shows  Actor and page classes to facilitate reuse and address device/browser variability
  • 3. Report Structure http://www.nasdanika.org/examples/test-report/#router/main/content/summary.html
  • 4. Summary, Test Coverage
  • 5. Actor Coverage
  • 6. Page Coverage
  • 7. Page Class Details
  • 8. Test Class Details
  • 9. Test Method Details
  • 10. Slide Show Opens by clicking on a screenshot in the carousel
  • 11. Parameterized Test
  • 12. How It Works
  • 13. Concepts  Test Case – A JUnit 4 test case class implementing WebTest interface.  Test Method – A JUnit test method. Uses Actor and Page specifications.  Page Specification – An interface abstracting test/actor code from the details of UI implementation.  Actor Specification – An interface abstracting tests from how a particular UI flow is implemented.  Page Implementation – An implementation of the Page Specification for a particular UI.  Actor Implementation – An implementation of the Actor Specification for a particular UI.  Page Factory – A factory interface for creating pages.  Actor Factory – A factory interface for creating actors.  Page Factory Implementation – An implementation of the page factory interface.  Actor Factory – An implementation of the actor factory interface.
  • 14. Annotations (partial list)  Wait – Applies to test/actor/page methods and page classes to wait for certain conditions (e.g. visibility of an element) before executing method or initializing page class.  Waits –Composite Wait – a collection of Wait annotations connected by AND.  Screenshot – Configures when to take a screenshot and allows to specify delay.  ActorFactory – A field annotation for injecting actor factory OSGi service into a test class.  PageFactory – A field annotation for injecting page factory OSGi service into a test class.  Pending –Test methods with this annotation are not executed, but included into the report. Can be used if a test is implemented before actors and pages it uses.
  • 15. Dependencies  Tests depend on actor/page specifications  Actor implementations depend on page specifications  Implementations are provided as OSGi services «@ActorFactory annotated field» + actorFactory :ActorFactory Actor Implementation Bundle Page Implementation Bundle Actor Specification Page Specification «interface» Page {specification} «interface» PageFactory {specification} + createPage() :Page «interface» Actor {specification} «interface» ActorFactory «JUnit T est» {specification} + createActor() :Actor PageImpl «OSGi Component» PageFactoryImpl + createPage() :Page PageFactory ActorImpl Factory injection into annotated fields ActorFactory Test «OSGi Component» ActorFactoryImpl + createActor() :Actor PageFactory Runtime Assembly by OSGi Declarative Services
  • 16. Test execution  Factory injection  The framework finds actor/page factory OSGi service  The framework creates a proxy to intercept method invocations  The framework injects the proxy into the test class  Test method execution  The framework takes a screenshot before and after method invocation (configurable)  Test code uses the injected factory to create actors and/or pages  The factory proxy creates proxies for actors and pages and returns them to the test  When test code invokes actor/page proxies’ methods they  Honor @Wait and @Waits annotations if any  Invoke the corresponding actor/page method  Take screenshots before and after actor/page method execution  Report generation  Duplicate screenshots are eliminated  Screenshots are organized into slide shows  Test/actor/page method calls are organized into a tree
  • 17. Page Class Specification Implementation fragment
  • 18. Page Factory Specification Implementation Component definition
  • 19. Actor Class Specification Implementation fragment
  • 20. Actor Factory Specification Implementation Page Factory is injected by OSGi Component definition
  • 21. Test Class (fragment) Factory is injected by the framework Suppressing BEFORE screenshot (blank page)
  • 22. Parameterized Test (fragment)
  • 23. Set up workspace(s)  Install NasdanikaWorkspaceWizard from http://www.nasdanika.org/server/repository  Install Maven Integration For Eclipse from the Eclipse Marketplace  Generate workspace projects – all in one workspace, or several workspaces, e.g. UI driver workspace and Tests project workspace
  • 24. Value Proposition  Reuse  Tests – use with different actor/page implementations.  Actors/pages – use in different tests.  Some functionality (e.g. Log-in or Sign-up tests) can be extracted into shared libraries and reused between applications – facilitates consistent user experience across applications.  Separation of concerns and duties  Analysts/Designers – define tests and Actor/Page specifications.  Test developers – implement tests and actor classes.  Application developers – implement page classes.  Screenshots allow visual inspection by a wide community of stakeholders.  Test reports can be used as a training and documentation resource which is always up to date.
  • 25. References  Wiki - https://github.com/Nasdanika/server/wiki/webtest  Sources - https://github.com/Nasdanika/server/tree/master/org.nasdanika.webtest  Example of UI driver - https://github.com/Nasdanika/examples-bank-ui-driver  Test application - https://github.com/Nasdanika/examples/tree/master/org.nasdanika.exa mples.bank.app.tests/src/org/nasdanika/examples/bank/app/tests  JavaDoc - http://www.nasdanika.org/server/apidocs/org/nasdanika/webtest/packag e-summary.html  Sample report - http://www.nasdanika.org/examples/test-report/# router/main/content/summary.html  P2 repository - http://www.nasdanika.org/repository

Related Documents