Skip to content

WebdriverIO + Docker compose + Selenium Grid + Cucumber + Image regression

Notifications You must be signed in to change notification settings

kamesh-a/webdriver-io-automation

Repository files navigation

Web automation assignment ( Docker + Selenium Grid + Cucumber + Javascript + WebdriverIO )

Requirements

  • Setup the solution with its Dockerized image - Docker compose with selenium-hub, selenium-node/chrome, selenium-node/firefox
  • Parallel execution of tests - Chrome:3 instances, Firefox:1 instance
  • Reporting of the results - Allure and Multiple cucumber Json reporter
  • Documentation

Addtional ( Bonus )

  • Kubernetes deploying - Work in Progress
  • Making use of wdio-image-comparison-service

Features

  • Test will run, parallely based on node instances aavailable with selenium-hub chrome/firefox nodes
  • BDD testing with Cucumber
  • Reporting with Allure
  • Reporting with multiple-cucumber-json-reporter
  • Given, Scenario, Step definitions and helper files written in typescript
  • Docker compose is used to start the selenium-hub

Version pre-requisite

  • Need node-js and java (allure-reporter)
    • Node.js - 10 or higher
    • Java - 8 or higher

Starting application testing

  1. Install Node dependencies:
npm install
  1. Install docker and run selenium:hub:
npm run selenium
  1. Running tests:
npm run test

To stop docker containers:

npm run selenium:stop

Gherking syntax Features Under test and grouping.

  • volvo.campaign.modal.feature - Tests related to modal dialog ex: cookie policy
  • volvo.campaign.nav.feature - Tests related to navigable elements in application ex: hamburger menu options Buy, Own etc.
  • volvo.campaign.screenshot.feature- Creates and image comparison test.

Report generation

  1. Allure report is automatically generated to open the reports
npm run report:allure
  1. Multiple cucumber json reporter will open automatically, but to open manually.
npm run report

Parallel Testing

  • WebdriverIO can run parallel test/features in case of multiple nodes availability with selenium hub. so We have configured chrome=3 and firefox=1 instance/node.
  • When run docker-compose up -d --scale chrome=3 or npm run selenium, we are spinning three chrome instances.
  • Webdriver IO will run all test in parallel in chrome due to available nodes
  • Webdriver IO will run sequentially in Firefox because of single instance/node.
  • We can use kubernetes to provision the nodes in selenium-hub based on demand ( Work in Progess)

Local dashboard urls

Screenshots:

About

WebdriverIO + Docker compose + Selenium Grid + Cucumber + Image regression

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published