Test Automation Framework (TAF)
Prerequisites:
Java 8
NodeJS
IDE - You can use any IDE that supports NodeJS/JavaScript development. For this document, Visual Studio Code was used
Visual Studio Code Recommended Extensions:
Cucumber (Gherkin) Full Support
Cuke Step Definition Generator
Gherkin Table Formatter
Running Tests Locally:
Download the repository to target directory.
In Visual Studio Code, open the directory.
Go to Terminal.
Install all the modules.
npm install
To run smoke tests with different browsers.
npm run test -- --env 'chrome' --tags '@smoke' npm run test -- --env 'firefox' --tags '@smoke' npm run test -- --env 'edge' --tags '@smoke'
To run smoke test with different browser in headless mode.
npm run test -- --env 'headless.chrome' --tags '@smoke' npm run test -- --env 'headless.firefox' --tags '@smoke' npm run test -- --env 'headless.edge' --tags '@smoke'
The test result report is at <working directory>/report/cucumber_report.html.
Running Tests in Pipeline:
In order to run tests in CI/CD pipeline, the easiest configuration is to setup a build agent in a Windows machine. The Edge browser currently only runs on Windows.
If that is not possible, another option is to setup the Selenium Grid. The Selenium hub will be running on the CI/CD server. A Selenium node running on Windows will connect to the Selenium hub.
Create a build configuration and run the tests using the headless mode.