A generic framework based on POM (Page Object Model) which takes care of Mweb, Web and Mobile Platforms(iOS and Android).
- Appium
- Selenium WebDriver
- Java
- Cucumber-java, Cucumber-junit
- jUnit
- Log4j
- Gradle
- imagemagick
This framework is built in BDD style using cucumber framework and scenarios will be run using cucumber-junit runners.
Scenario tagging:
@web - for web tests
@mweb - for Mweb tests
@android - for Android tests
@ios - for iOS tests
@ignore - to ignore certain tests
@visual - to include visual tests
- Tests can be executed in two modes
1. tulna.mode='build'
2. tulna.mode='compare'
- What's build or compare?
1. If you need to capture fresh baselines, then run it in build mode
2. If you want a comparison, then run it in compare mode
-
Running tag based features
gradle clean test -Pplatform=web -Pbrowser=chrome -Penv=qa -Ptulna.mode=compare -Ptulna.platform=web -Ptags="@home"
-
Execution on different platforms
-
FOR Web:
gradle clean test -Pplatform=web -Pbrowser=chrome -Penv=qa -Ptulna.mode=<build/compare> -Ptulna.platform=web -Ptags="@tag1,@tag2"
-
FOR MWeb:
gradle clean test -Pplatform=mweb -Pbrowser=chrome -Penv=qa -Ptulna.mode=<build/compare> -Ptulna.platform=mweb -Ptags="@tag1,@tag2"
-
FOR Android:
gradle clean test -Pplatform=android -Ptulna.mode=build -Ptulna.platform=android -Ptulna.platform=mweb -Ptags="@tag1,@tag2"
-
FOR iOS:
gradle clean test -Pplatform=iOS -Ptulna.mode=build -Ptulna.platform=iOS -Ptulna.platform=mweb -Ptags="@tag1,@tag2"
-
-
Test Report Location -
/cucumber-report/index.html
-
Execution with visual mode as 'build':
- All the baselines are stored in
Baselines
directory (/web/baseline_images
)
- All the baselines are stored in
-
Execution with visual mode as 'compare' :
- In case a test fails, actual and difference images are generated in
Baselines
directory under sub-directory 'actual_images' (/web/actual_images
)
- In case a test fails, actual and difference images are generated in
-
Want to mask some dynamic content during visual comparison?
- Add the co-ordinates for the image which you want to mask in
tulna.yaml
(Ex.homepage: {from_date: [x1, x2, y1, y2]}
) - Add locators for elements which needs masking in
tulna.yaml
(Ex.homepage: ["css:div.highlight__decoration[style^=\"top\"]"]
) - Tool you can use to find co-ordinates - GIMP
- Add the co-ordinates for the image which you want to mask in
- Comment `options.addArguments("headless");` in DriverManager class.
Fork the project, make a change, and send a pull request! Danke!