4.13.0 • Published 20 days ago

expect-webdriverio v4.13.0

Weekly downloads
136,515
License
MIT
Repository
github
Last release
20 days ago

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 v8.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)
4.13.0

20 days ago

4.12.2

1 month ago

4.11.10

2 months ago

4.12.0

2 months ago

4.12.1

2 months ago

4.11.9

2 months ago

4.11.8

3 months ago

4.11.5

3 months ago

4.11.6

3 months ago

4.11.7

3 months ago

4.11.4

3 months ago

4.11.3

3 months ago

4.11.0

3 months ago

4.11.1

3 months ago

4.11.2

3 months ago

4.10.1

3 months ago

4.10.0

3 months ago

4.9.4

3 months ago

4.9.3

3 months ago

4.9.0

3 months ago

4.9.2

3 months ago

4.9.1

3 months ago

4.8.1

4 months ago

4.8.0

4 months ago

4.7.2

5 months ago

4.7.1

5 months ago

4.7.0

5 months ago

4.6.1

5 months ago

4.6.0

5 months ago

4.5.0

6 months ago

4.5.2

5 months ago

4.5.1

6 months ago

4.4.1

7 months ago

4.4.0

7 months ago

4.2.8

8 months ago

4.3.0

7 months ago

4.2.7

10 months ago

4.2.5

11 months ago

4.2.4

11 months ago

4.2.6

11 months ago

3.6.0

1 year ago

4.2.3

12 months ago

4.2.2

12 months ago

4.2.1

1 year ago

4.2.0

1 year ago

4.1.3

1 year ago

4.1.2

1 year ago

4.1.1

1 year ago

4.0.0-alpha.5

1 year ago

4.0.0-alpha.6

1 year ago

4.0.0-alpha.4

2 years ago

4.0.1

1 year ago

3.5.3

1 year ago

3.5.2

1 year ago

3.5.1

1 year ago

3.5.0

1 year ago

4.1.0

1 year ago

4.0.0-alpha.3

2 years ago

4.0.0-alpha.1

2 years ago

4.0.0-alpha.2

2 years ago

4.0.0-alpha.0

2 years ago

3.4.0

2 years ago

3.3.1

2 years ago

3.3.0

2 years ago

3.2.1

2 years ago

3.3.2

2 years ago

3.2.0

2 years ago

3.1.4

3 years ago

3.1.3

3 years ago

4.0.0

3 years ago

3.1.2

3 years ago

3.1.1

3 years ago

3.1.0

3 years ago

2.0.2

3 years ago

3.0.0

3 years ago

2.0.1

3 years ago

2.0.0

3 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

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago

0.2.0

4 years ago

0.1.0-beta.4

4 years ago

0.1.2-beta.6

4 years ago

0.1.1-beta.5

4 years ago

0.1.3-beta.7

4 years ago

0.0.1-alpha.3

4 years ago

0.0.1-alpha.2

4 years ago

0.0.1-alpha.1

4 years ago

0.0.1-alpha.0

4 years ago