jest-environment-webdriverio
Run your tests using Jest and WebdriverIO
Installation
Using npm:
npm install --save-dev jest-environment-webdriverio
Using yarn:
yarn add --dev jest-environment-webdriverio
Set jest-environment-webdriverio
as the testEnvironment
in your Jest configuration. Additionally, specify any WebdriverIO options in testEnvironmentOptions
:
// jest.config.jsmoduleexports = testEnvironment: "jest-environment-webdriverio" testEnvironmentOptions: host: "hub.crossbrowsertesting.com" port: 80 user: "<username>" key: "<authkey>" desiredCapabilities: name: "Jest -> WebdriverIO -> CrossBrowserTesting" platform: "Windows 7" browserName: "ie" version: "11" record_video: "true" record_network: "true" ;
Usage
You are now ready to use WebdriverIO's global browser
, $
, and $$
methods in your tests. Be sure to use the async/await
syntax:
// google.spec.js;