An open API service indexing awesome lists of open source software.

https://github.com/lynix28/web-webdriverio-example

Web automation testing example project with WebdriverIO
https://github.com/lynix28/web-webdriverio-example

automated-testing bdd-tests mocha-framework wdio web-testing webdriverio

Last synced: 3 months ago
JSON representation

Web automation testing example project with WebdriverIO

Awesome Lists containing this project

README

          

# web-webdriverio-example

[![CircleCI](https://dl.circleci.com/status-badge/img/gh/lynix28/web-webdriverio-example/tree/master.svg?style=shield)](https://dl.circleci.com/status-badge/redirect/gh/lynix28/web-webdriverio-example/tree/master)

Description:

An example project about Web automation testing using WebdriverIO. The test examples are created in Mocha Framework and Cucumber Framework.

Inside the project:

- WebdriverIO Packages
- Mocha and Cucumber as Test Framework
- Allure as Test Reporter
- `selenium-standalone-service` as service to run the test locally with your own browser
- `wdio-safaridriver-service` as service to run the test locally in Safari browser

- The Webdrivers
- Chrome = chromedriver
- Firefox = geckodriver
- Ms Edge = edgedriver
- Safari = safaridriver \
to enable the driver, run `safaridriver --enable` on terminal (need to use MacOS to enable the feature)

How to setup:

- Clone the project \
Run `npm install`

- Make sure the browser also installed and match with the webdriver version

How to run the test:



Mocha Framework:

- all the test
- `npm run test`
- specific spec / test file
- `npm run test -- --spec ./to/file/location.js`
- specific suite / test suite
- `npm run test -- --suite "suiteName"`
- specific test case
- `npm run test -- --spec ./to/file/location.js --mochaOpts.grep "testcase name or testing tag"`
- `npm run test -- --suite "suiteName" --mochaOpts.grep "testcase name or testing tag"`
- running test on Safari
- start the driver with command `safaridriver -p ` (make sure to use same port with the 'wdio configuration')
- run the test `npm run test-safari`

Cucumber Framework:

- all the test
- `npm run test-bdd` (Cucumber)
- specific spec / test file
- `npm run test-bdd -- --spec ./to/file/location.feature` (Cucumber)