
Security News
Google’s OSV Fix Just Added 500+ New Advisories — All Thanks to One Small Policy Change
A data handling bug in OSV.dev caused disputed CVEs to disappear from vulnerability feeds until a recent fix restored over 500 advisories.
expect-webdriverio
Advanced tools
WebdriverIO Assertion library inspired by expect
npm install expect
(Jasmine and Jest users should skip this step)npm install expect-webdriverio
NOTE: WebdriverIO v9.0.0
or higher is required!
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
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)
Please see API doc
Error messages are informative out of the box and contain:
$('form').$('input')
First of all, feel free to raise an issue with your suggestions or help with PR!
Chai is a BDD / TDD assertion library for node and the browser that can be delightfully paired with any javascript testing framework. It provides a variety of assertion styles and is often used with WebdriverIO, but it does not have built-in support for WebdriverIO-specific matchers.
Jest is a delightful JavaScript Testing Framework with a focus on simplicity. It provides a rich set of matchers and is often used for unit testing. While it can be used with WebdriverIO, it does not have built-in support for WebdriverIO-specific matchers.
Assert is a simple assertion library provided by Node.js. It is minimalistic and does not provide the rich set of matchers that expect-webdriverio offers, especially for WebdriverIO-specific assertions.
FAQs
WebdriverIO Assertion Library
The npm package expect-webdriverio receives a total of 782,652 weekly downloads. As such, expect-webdriverio popularity was classified as popular.
We found that expect-webdriverio demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A data handling bug in OSV.dev caused disputed CVEs to disappear from vulnerability feeds until a recent fix restored over 500 advisories.
Research
/Security News
175 malicious npm packages (26k+ downloads) used unpkg CDN to host redirect scripts for a credential-phishing campaign targeting 135+ organizations worldwide.
Security News
Python 3.14 adds template strings, deferred annotations, and subinterpreters, plus free-threaded mode, an experimental JIT, and Sigstore verification.