GithubHelp home page GithubHelp logo

scthi / jest-environment-webdriverio Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jaysirju/jest-environment-webdriverio

1.0 1.0 0.0 1.38 MB

Run your tests using Jest and WebdriverIO

Home Page: https://www.npmjs.com/package/jest-environment-webdriverio

License: MIT License

JavaScript 14.79% TypeScript 85.21%

jest-environment-webdriverio's Introduction

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

jest-environment-webdriverio's People

Contributors

iiroj avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.