Giter Club home page Giter Club logo

tojtech3's Introduction

Intro

This is selenium based UI test automation framework for both member and recruiter sides.

Environment Setup

Development Environment

  1. Java - is used as the main coding language.
  2. Maven - is used as build and dependencies management tool.
  3. Chrome - Chrome browser.
  4. ChromeDriver - standalone server for Chrome browser that implements the W3C WebDriver standard.

CI Environment

  1. Docker - is used:
    1. spin up Selenoid - Selenium Grid
    2. executed tests

Configuration Options

All the test framework related configs are stored in config.properties file. In order to overwrite default values either:

  • Update the appropriate key in config.properties file.
  • Pass the updated key as java environment variable into during tests run with maven. E.g. selenium.browser.isGrid=false is set to false in config.properties but during run on Jenkins we need to use selenium grid so that we are setting it to true by:
mvn clean install -Dselenium.browser.isGrid=true

Tests Execution

There are 3 ways of tests execution: fully local, fully dockerized and mixed.

  • Fully local is the preferred way during tests development as it simplifies debug process. It requires [Development Environment] environment setup because tests are executed (from IDE or using maven) against locally installed Chrome browser. As it's the default way of running tests (as per the configuration file) no additional parameters are required for running all the tests with maven:
mvn clean install
  • Fully dockerized is the preferred way to execute tests as part of CI flow. See docker-compose.yml It requires [CI Environment] environment setup because tests are executed in docker containers. For the first run related docker containers should be pulled with:
docker pull selenoid/chrome:latest 
docker pull selenoid/opera:latest
docker-compose pull

In order to execute all the tests:

docker-compose down
docker-compose run tests mvn clean install -Dselenium.browser.isGrid=true -DparallelTestsCount=7
docker-compose down
  • Mixed In order to execute tests from local environment using selenium grid. It requires both [Development Environment] and [CI Environment] setup. In order to run tests:
  1. Selenium Grid should be started
  2. Grid URL should be set in config.properties
  3. isGrid flag should be set to true After that you will be able to execute tests in the same way as in [Fully local] case but the dockerized browsers will be used.

Reporting

Generated reports are stored in the following locations:

  • cucumber report: ui_tests/target/cucumber/index.html
  • cucumber timeline report: ui_tests/target/cucumberTimeline/index.html The better implementation of reports is available on CI with cucumber-reports plugin.

Screenshots capture

Set selenium.browser.enableScreenShotsCapture flag to true in order to capture screenshots on open of page objects. They will be stored in: ui_tests/target/features folder

Libraries

  1. TestNG - tests execution and assertions.
  2. Cucumber - behaviour driven development (BDD) support.
  3. Selenium - browser interaction API.

Troubleshooting Notes

  1. If browser doesn't start:
    1. Check if version of chromedriver (chromedriver(.exe) -v in terminal) matches version of inatalled chrome browser
    2. Check if Glue is set to com.saucedemo in Run/Debug Configurations > Templates > Cucumber java > Glue line
  2. Fully Dockerized execution on Windows platform is TBD. Please use Mixed approach.

tojtech3's People

Contributors

ydanylchenkol avatar makelaqa avatar ydanylchenko avatar tojtech avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.