A cross browser test automation app using Gauge
and WebdriverIO
-
Install Active LTS (Long Term Support) version of Node.js and use npm@6
-
Clone the repo and install dependencies
git clone https://github.com/pradeep0601/gauge-wdio-x-browser-test.git
# Switch to the project directory
cd gauge-wdio-x-browser-test
# Install project node modules.
yarn
Use below grunt commands to execute test -
It will run test as per given options.
options
--browser=<browserName>
runs test on given browser.(supported browser: chrome(default), firefox, edge, ie and safari)--bstack
runs test against given browser on cloud testing platform:Browser Stack
--headless
runs test against given browser in headless mode (supported browser: chrome, firefox)--tags=<tagName>
runs only thosescenario
which is tagged with given tagName.--env=<envValue>
runs test on given environment (Valid value: integration, prod).
grunt gauge-tests --browser=ie --bstack
will run tests on BrowserStack
against internet explorer
grunt gauge-tests --browser=ie
will run all tests locally
against internet explorer
grunt gauge-tests --browser=ie --tags=uat
will run all scenarios tagged with uat
locally
against internet explorer
grunt gauge-tests --browser=edge --tags=uat --bstack
will run all scenarios tagged with uat
on BrowserStack
against microsoft edge
You can use below yarn commands as well to run test cases
Syntax: yarn test:<browser>:[bstack]
Example:
yarn test:ie will run tests locally
yarn test:ie:bstack will run tests on BrowserStack
Note: To execute tests on BrowserStack you will have to keep browser stack's credentials in /env/default/gauge.propperties file like as below -
BROWSERSTACK_USERNAME = **************
BROWSERSTACK_ACCESS_KEY = *************