This package has been deprecated

Author message:

This package is no longer maintained

jest-environment-webdriverio
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

jest-environment-webdriverio

GitHub Actions version code size dependencies devDependencies

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.js
module.exports = {
  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
describe("DuckDuckGo", (): void => {
  it("should contain the Duck logo", async (): Promise<void> => {
    await browser.url("https://duck.com");
    const logo = await $("a#logo_homepage_link");
    await logo.waitForExist();
    expect(await browser.getUrl()).toEqual("https://duckduckgo.com");
    expect(await logo.getCSSProperty("background-image")).toContain(".svg");
    expect(await logo.getText()).toContain("About DuckDuckGo");
  });
});

Package Sidebar

Install

npm i jest-environment-webdriverio

Weekly Downloads

1

Version

2.0.0

License

MIT

Unpacked Size

13 kB

Total Files

6

Last publish

Collaborators

  • iiroj