Skip to content
Arjie Cristobal edited this page Jun 6, 2020 · 1 revision

Welcome to the Selenium-WebdriverIO wiki!

npm test -- --spec=tests/contactUsTest.js
https://www.npmjs.com/

upgrade to version 5.0
npm install webdriverio@latest
npm install @wdio/cli --save-dev
./node_modules/.bin/wdio config

REM Package.json Setup
npm init

REM Downloading the Latest WebdriverIO v5 Packages
npm i --save-dev webdriverio@latest @wdio/cli mocha@latest selenium-standalone@latest @wdio/selenium-standalone-service

REM Prettier Setup (formatting)
REM create prettierrc.json
REM install prettier plugin in VS Code

REM Configuring new wdio file
./node_modules/.bin/wdio config

REM Babel is a Javascript compiler
REM babeljs.io/docs/babel.html
npm install --save-dev @babel/core @babel/cli @babel/preset-env @babel/register

REM Selenium Server
.\node_modules.bin\selenium-standalone install
.\node_modules.bin\selenium-standalone start
REM in case the default 4444 is already in used
REM http://localhost:4444/
.\node_modules.bin\selenium-standalone start -- -port 7777

REM to run automatically the selenium server, add an entry in package.json
REM to run in local
npm run selenium-server

REM one of running the test
.\node_modules.bin\wdio wdio.conf.js

REM to run the selenium-server (@see package.json)
npm run selenium-server

REM to run the test in test folder (@see package.json)
npm test

REM install chrome driver (@see https://webdriver.io/docs/wdio-chromedriver-service.html
npm install wdio-chromedriver-service --save-dev
npm install chromedriver --save-dev

REM Chai is a BDD / TDD assertion library for node
REM add in wdio before the following: expect = require('chai').expect;
npm i --save-dev chai@latest

REM Section 47: Config File Creation (Centralising & Managing Variables)
REM Section 50: Page Object Pattern
REM webdriver.io/docs/pageobjects.html
REM page-objects/Base_PO.js and ContactUs_PO.js and contact-us-test.js

REM run a particular test suite
npm test -- --suite contactus
REM if we only want to run the test cases in one browser, set the maxInstances: 1 in wdio
REM for retry of test case, change specFileRetries in wdio.

Clone this wiki locally