expect-webdriverio
WebdriverIO Assertion Library
Last updated 7 months ago by wdio-user .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install expect-webdriverio 
SYNC missed versions from official npm registry.

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 v9.0.0 or higher is required!

Usage

Using WebdriverIO Testrunner

If you run your tests through the WDIO testrunner no additional setup is needed. WebdriverIO initialises expect-webdriverio and makes expect available in the global scope. So you can use it directly in your tests:

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

See more Examples

Using in a standalone script

If you embed WebdriverIO in a standalone script, make sure you import expect-webdriverio before you use it anywhere.

import { remote } from 'webdriverio'
import { expect } from 'expect-webdriverio'

;(async () => {
    const browser = await remote({
        capabilities: {
            browserName: 'chrome'
        }
    })

    await browser.url('https://webdriver.io')

    const $button = await browser.$('button')
    await expect($button).toBeDisplayed()
    
    await browser.deleteSession()
})().catch(console.error)

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

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)

Current Tags

  • 5.0.3                                ...           latest (3 months ago)
  • 4.15.4                                ...           legacy-v4 (4 months ago)
  • 5.0.0-alpha.2                                ...           next (5 months ago)

110 Versions

  • 5.0.3                                ...           3 months ago
  • 5.0.2                                ...           4 months ago
  • 4.15.4                                ...           4 months ago
  • 5.0.1                                ...           4 months ago
  • 5.0.0                                ...           4 months ago
  • 4.15.3                                ...           4 months ago
  • 4.15.2                                ...           4 months ago
  • 5.0.0-alpha.2                                ...           5 months ago
  • 5.0.0-alpha.1                                ...           5 months ago
  • 5.0.0-alpha.0                                ...           5 months ago
  • 4.15.1                                ...           6 months ago
  • 4.15.0                                ...           6 months ago
  • 4.14.0                                ...           7 months ago
  • 4.13.0                                ...           8 months ago
  • 4.12.2                                ...           9 months ago
  • 4.12.1                                ...           9 months ago
  • 4.12.0                                ...           9 months ago
  • 4.11.10                                ...           9 months ago
  • 4.11.9                                ...           10 months ago
  • 4.11.8                                ...           10 months ago
  • 4.11.7                                ...           10 months ago
  • 4.11.6                                ...           10 months ago
  • 4.11.5                                ...           10 months ago
  • 4.11.4                                ...           a year ago
  • 4.11.3                                ...           a year ago
  • 4.11.2                                ...           a year ago
  • 4.11.1                                ...           a year ago
  • 4.11.0                                ...           a year ago
  • 4.10.1                                ...           a year ago
  • 4.10.0                                ...           a year ago
  • 4.9.4                                ...           a year ago
  • 4.9.3                                ...           a year ago
  • 4.9.2                                ...           a year ago
  • 4.9.1                                ...           a year ago
  • 4.9.0                                ...           a year ago
  • 4.8.1                                ...           a year ago
  • 4.8.0                                ...           a year ago
  • 4.7.2                                ...           a year ago
  • 4.7.1                                ...           a year ago
  • 4.7.0                                ...           a year ago
  • 4.6.1                                ...           a year ago
  • 4.6.0                                ...           a year ago
  • 4.5.2                                ...           a year ago
  • 4.5.1                                ...           a year ago
  • 4.5.0                                ...           a year ago
  • 4.4.1                                ...           a year ago
  • 4.4.0                                ...           a year ago
  • 4.3.0                                ...           a year ago
  • 4.2.8                                ...           a year ago
  • 4.2.7                                ...           a year ago
  • 4.2.6                                ...           2 years ago
  • 4.2.5                                ...           2 years ago
  • 4.2.4                                ...           2 years ago
  • 4.2.3                                ...           2 years ago
  • 4.2.2                                ...           2 years ago
  • 4.2.1                                ...           2 years ago
  • 4.2.0                                ...           2 years ago
  • 4.1.3                                ...           2 years ago
  • 3.6.0                                ...           2 years ago
  • 4.1.2                                ...           2 years ago
  • 4.1.1                                ...           2 years ago
  • 4.1.0                                ...           2 years ago
  • 4.0.1                                ...           2 years ago
  • 3.5.3                                ...           2 years ago
  • 3.5.2                                ...           2 years ago
  • 3.5.1                                ...           2 years ago
  • 3.5.0                                ...           2 years ago
  • 4.0.0-alpha.6                                ...           2 years ago
  • 4.0.0-alpha.5                                ...           2 years ago
  • 4.0.0-alpha.4                                ...           2 years ago
  • 4.0.0-alpha.3                                ...           2 years ago
  • 4.0.0-alpha.2                                ...           2 years ago
  • 4.0.0-alpha.1                                ...           2 years ago
  • 4.0.0-alpha.0                                ...           2 years ago
  • 3.4.0                                ...           3 years ago
  • 3.3.2                                ...           3 years ago
  • 3.3.1                                ...           3 years ago
  • 3.3.0                                ...           3 years ago
  • 3.2.1                                ...           3 years ago
  • 3.2.0                                ...           3 years ago
  • 3.1.4                                ...           3 years ago
  • 3.1.3                                ...           3 years ago
  • 4.0.0 [deprecated]           ...           3 years ago
  • 3.1.2                                ...           3 years ago
  • 3.1.1                                ...           3 years ago
  • 3.1.0                                ...           4 years ago
  • 3.0.0                                ...           4 years ago
  • 2.0.2                                ...           4 years ago
  • 2.0.1                                ...           4 years ago
  • 2.0.0                                ...           4 years ago
  • 1.4.1                                ...           4 years ago
  • 1.4.0                                ...           4 years ago
  • 1.3.1                                ...           4 years ago
  • 1.3.0                                ...           4 years ago
  • 1.2.0                                ...           4 years ago
  • 1.1.5                                ...           5 years ago
  • 1.1.3                                ...           5 years ago
  • 1.1.2                                ...           5 years ago
  • 1.1.1 [deprecated]           ...           5 years ago
  • 1.1.0                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
  • 0.2.0                                ...           5 years ago
  • 0.1.3-beta.7                                ...           5 years ago
  • 0.1.2-beta.6                                ...           5 years ago
  • 0.1.1-beta.5                                ...           5 years ago
  • 0.1.0-beta.4                                ...           5 years ago
  • 0.0.1-alpha.3                                ...           5 years ago
  • 0.0.1-alpha.2                                ...           5 years ago
  • 0.0.1-alpha.1                                ...           5 years ago
  • 0.0.1-alpha.0                                ...           5 years ago
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (4)
Dev Dependencies (19)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE