fwouts / webdriverio-jest

Example of a WebdriverIO test written with the Jest framework

Home Page:https://github.com/webdriverio/webdriverio/issues/2052

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WebdriverIO with Jest

CircleCI

This is the simplest possible example of a WebdriverIO test written with the Jest framework.

Because WebdriverIO doesn't support Jest as a first-class citizen, this test suite leverages the WebdriverIO remote API. This means that we need to do a few things ourselves, such as starting up Selenium server as well as the browser. It also means that we must use async/await statements.

How to use it

npm install
npm test

Picking a different browser

The browser is chosen based on the BROWSER_NAME environment variable, defaulting to chrome.

Examples:

BROWSER_NAME=chrome npm test
BROWSER_NAME=safari npm test
BROWSER_NAME=firefox npm test
BROWSER_NAME="internet explorer" npm test
BROWSER_NAME=MicrosoftEdge npm test

Running with Chrome headless

Simply set the HEADLESS environment variable to 1:

HEADLESS=1 npm test

TypeScript

Check out the typescript branch for the equivalent test written in TypeScript.

About

Example of a WebdriverIO test written with the Jest framework

https://github.com/webdriverio/webdriverio/issues/2052

License:MIT License


Languages

Language:JavaScript 100.0%