Skip to content

olenakhom/web-test

Repository files navigation

Coding challenge

Stack of technologies

  1. Java 11
  2. Maven
  3. Selenide
  4. Junit5
  5. Rest Assured
  6. Allure Reporting Tool

Required installation

  1. Java 11 or higher
  2. IntelliJ IDEA
  3. Lombok Plugin
  4. Allure commandline for generation test report
  5. Maven for running tests from command line
  6. Latest Chrome browser need to be installed for running UI tests
  7. Docker need to be installed for running UI tests in docker container (using Zalenium for example)

Available Test Configurations via Maven:

  • -Dplatform: local, (linux, windows, mac, selenoid - will be available after configuring remote machines). Default value is local.
  • -Denv: local, qa, prod. Default value is prod
  • -DtestTags: smoke, regression, employee. Default value is regression
  • -Dbrowser: safari, chrome, firefox. Default value is chrome
  • -DthreadCount: number of threads for parallel execution of UI tests, for safari browser should be 1. API tests are running always in 1 thread. Default value for UI tests is 3.
  • -Pui, -Papi: profiles to run UI or API test suites. Default value is api

Prerequisites for Running UI Tests on Local Machine (Platform)

Via Selenium Standalone Server (Chrome and Safari browsers)

  • Run script startSeleniumGrid.sh for Mac/Linux or startSeleniumGrid.bat for Windows to start Selenium Grid locally. For MacOs to enable running tests on Safari browser write in terminal safaridriver --enable and config in maven command -Dbrowser=safari -DthreadCount=1
  • Open URL http://localhost:4444/grid/console to check the Selenium Nodes.

Via Zalenium (Chrome and Firefox browsers)

Zalenium Documentation

  • Run command docker-compose up --force-recreate of docker-compose.yml file

After running the previous commands, you can check:

UI Test Execution

Run tests from command line

mvn clean -Pui -Denv=prod -Dplatform=local -Dbrowser=chrome -DtestTags=regression -DthreadCount=3 test

or

mvn clean -Pui test

API Test Execution

Run tests from command line

mvn clean -Papi -Denv=prod -DtestTags=regression test

or

mvn clean -Papi test

Allure test report generation

This is already enough to see the Allure report in one command:

allure serve /{project_root_path}/target/allure-results

If report generated successfully, report page should be opened automatically in the browser.

Example of UI tests execution: Allure Report

Example of API tests execution: Allure Report

About

Technical task

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published