View Code? Open in Web Editor
NEW
Home Page: https://qaschevychelov.github.io/JSWebdriverioAutomation/
License: MIT License
JavaScript 69.29%
TypeScript 29.26%
Batchfile 1.45%
jswebdriverioautomation's Introduction
WebDriver.io Sample Project for JS Automation
The 1st try of building automation with JS
- install Node.js (i use v12.18.3 LTS)
cd
to the project folder
- run tests both
- via
npm install
and then npm test
- or via
npm cit
- this command will fetch project dependencies and run tests
2 Approach: The simplest way of test running with docker-compose on Selenoid
cd
in the folder selenoid
- in cmd run
docker-compose up -d
- docker will download and deploy Selenoid (back & front)
- in cmd run
docker pull selenoid/vnc_chrome:<VERSION>
- we need to manually download vnc
-versions of browsers
VERSION
- you cand set this version in a file selenoid/config/browsers.json
and use in the command above
- in order to run tests use the following command in cmd
$env:SELENOID='true' ; npm test
- if you need to kill Selenoid run the following command
docker-compose down
3 Approach: In Order to run in parallel with Selenoid (on Windows)
cd
in the folder selenoid
- in cmd run
selenoid.exe selenoid --args "-limit 10" start --vnc
- in cmd run
selenoid.exe selenoid-ui start
- in order to run tests use the following command in cmd
$env:SELENOID='true' ; npm test
4 Approach: The Selenium Grid Approach:
- open
wdio.conf.js
- comment line
services:
- uncomment firefox capability
maxInstances: 5
, browserName: 'firefox'
, acceptInsecureCerts: true
- start the file
start_selenium_grid_hub.bat
- start the file
start_10_chrome_node.bat
- start the file
start_10_firefox_node.bat
- in
wdio.conf.js
set hostname: '<IP of grid hub>'
- in
wdio.conf.js
set port: 4444
- in
wdio.conf.js
set path: '/wd/hub'
- install allure CLI globally via
npm i -g allure-commandline
- run your test with one of the approaches above
- in the project folder run
npm run report
- it will create allure-results
folder
- in the project folder run
allure serve
in order to deploy Allure Report
You can see Allure report for this automation project here
This method is implemented in order to automate chat-apps. The approach uses WDIO multiremote feature
- WORKS WITH APPIUM V.1.18.1
- place mobile tests in
test/android
folder
- prepare 2 Android emulators/phones
- run tests with
npm run android.app
- phone1
and phone2
will be created. These are driver instances. With them you can control each device