Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fwouts/webdriverio-jest
Example of a WebdriverIO test written with the Jest framework
https://github.com/fwouts/webdriverio-jest
automation jest testing webdriverio
Last synced: 2 months ago
JSON representation
Example of a WebdriverIO test written with the Jest framework
- Host: GitHub
- URL: https://github.com/fwouts/webdriverio-jest
- Owner: fwouts
- License: mit
- Created: 2018-08-28T21:51:34.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-08-28T22:58:38.000Z (over 6 years ago)
- Last Synced: 2024-11-02T13:42:24.431Z (3 months ago)
- Topics: automation, jest, testing, webdriverio
- Language: JavaScript
- Homepage: https://github.com/webdriverio/webdriverio/issues/2052
- Size: 137 KB
- Stars: 22
- Watchers: 3
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# WebdriverIO with Jest
[![CircleCI](https://circleci.com/gh/zenclabs/webdriverio-jest.svg?style=svg)](https://circleci.com/gh/zenclabs/webdriverio-jest)
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
```sh
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](https://github.com/zenclabs/webdriverio-jest/tree/typescript)
for the equivalent test written in TypeScript.