expect-webdriverio
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
npm install expect(Jasmine and Jest users should skip this step)npm install expect-webdriverio
NOTE: WebdriverIO v5.16.11 or higher is required!
Usage
In your wdio.conf.js
beforeSession () { // before hook works as well
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)
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)

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.



