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:

  1. Download the repository to target directory.

  2. In Visual Studio Code, open the directory.

  3. Go to Terminal.

  4. Install all the modules.

    npm install
  5. 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'
  6. 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'
  7. 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.