Have ideas to improve npm?Join in the discussion! »

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

    2.0.1 • Public • Published

    expect-webdriverio

    Test

    API | TypeScript / JS Autocomplete | Examples | Extending Matchers

    WebdriverIO Assertion library inspired by expect

    Key Features

    • waits for expectation to succeed
    • detailed error messages
    • works in Mocha, Cucumber, Jest, Jasmine
    • builtin types for TypeScript and JS autocompletion

    Installation

    1. npm install expect (Jasmine and Jest users should skip this step)
    2. npm install expect-webdriverio

    NOTE: WebdriverIO v5.16.11 or higher is required!

    Usage

    In your wdio.conf.js

    before () { // not needed in WebdriverIO v6
        require('expect-webdriverio')
    },

    In your test

    const $button = $('button')
    expect($button).toBeDisplayed()

    See more Examples

    API

    Please see API doc

    Error messages

    Error messages are informative out of the box and contain:

    • full element selector, like $('form').$('input')
    • actual and expected values
    • highlight the difference (texts assertions)

    toHaveText toHaveElementClass not.toBeVisible

    What's next?

    First of all, feel free to raise an issue with your suggestions or help with PR!

    Planned

    • css matcher
    • size matcher
    • cookie / localStorage matchers?
    • text regex matchers
    • multiremote support (if requested)

    Install

    npm i expect-webdriverio

    DownloadsWeekly Downloads

    151,295

    Version

    2.0.1

    License

    MIT

    Unpacked Size

    77.8 kB

    Total Files

    50

    Last publish

    Collaborators

    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar