2.0.0 • Published 3 years ago

jest-environment-webdriverio v2.0.0

Weekly downloads
34
License
MIT
Repository
github
Last release
3 years ago

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");
  });
});
1.0.17

3 years ago

1.0.16

3 years ago

2.0.0

3 years ago

1.0.15

4 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago