{"id":20560195,"url":"https://github.com/webdriverio/expect-webdriverio","last_synced_at":"2026-01-27T09:18:41.207Z","repository":{"id":37970004,"uuid":"223188737","full_name":"webdriverio/expect-webdriverio","owner":"webdriverio","description":"WebdriverIO Assertion Library","archived":false,"fork":false,"pushed_at":"2024-05-18T01:11:02.000Z","size":7052,"stargazers_count":70,"open_issues_count":13,"forks_count":48,"subscribers_count":13,"default_branch":"main","last_synced_at":"2024-05-19T16:15:18.281Z","etag":null,"topics":["assertion-library","expect","hacktoberfest","webdriverio"],"latest_commit_sha":null,"homepage":"https://webdriver.io","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/webdriverio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"tidelift":"npm/webdriverio","open_collective":"webdriverio"}},"created_at":"2019-11-21T14:09:38.000Z","updated_at":"2024-08-15T17:20:21.183Z","dependencies_parsed_at":"2024-01-13T14:44:29.879Z","dependency_job_id":"3568add7-d3ba-415a-910a-576e9818b460","html_url":"https://github.com/webdriverio/expect-webdriverio","commit_stats":{"total_commits":1334,"total_committers":30,"mean_commits":44.46666666666667,"dds":0.4220389805097451,"last_synced_commit":"7d249bedf5ea0bdaf5cc196ff18d47cdd0817ce8"},"previous_names":[],"tags_count":96,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webdriverio%2Fexpect-webdriverio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webdriverio%2Fexpect-webdriverio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webdriverio%2Fexpect-webdriverio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webdriverio%2Fexpect-webdriverio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webdriverio","download_url":"https://codeload.github.com/webdriverio/expect-webdriverio/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246737634,"owners_count":20825658,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["assertion-library","expect","hacktoberfest","webdriverio"],"created_at":"2024-11-16T03:53:25.422Z","updated_at":"2025-12-24T03:58:27.724Z","avatar_url":"https://github.com/webdriverio.png","language":"TypeScript","funding_links":["https://tidelift.com/funding/github/npm/webdriverio","https://opencollective.com/webdriverio"],"categories":[],"sub_categories":[],"readme":"# expect-webdriverio [![Test](https://github.com/webdriverio/expect-webdriverio/actions/workflows/test.yml/badge.svg)](https://github.com/webdriverio/expect-webdriverio/actions/workflows/test.yml)\n\n\n###### [API](docs/API.md) | [TypeScript / JS Autocomplete](docs/Types.md) | [Examples](docs/Examples.md) | [Extending Matchers](docs/CustomMatchers.md)\n\n\u003e [WebdriverIO](https://webdriver.io/) Assertion library inspired by [expect](https://www.npmjs.com/package/expect)\n\n## Key Features\n\n- [waits](#default-options) for expectation to succeed\n- detailed [error messages](#error-messages)\n- works in Mocha, Cucumber, Jest, Jasmine\n- builtin [types](docs/Types.md) for TypeScript and JS autocompletion\n\n## Installation\n\n1. `npm install expect` (**Jasmine** and **Jest** users should skip this step)\n2. `npm install expect-webdriverio`\n\nNOTE: [WebdriverIO](https://github.com/webdriverio/webdriverio) `v9.0.0` or higher is required!\n\n## Usage\n\n### Using WebdriverIO Testrunner\n\nIf you run your tests through the [WDIO testrunner](https://webdriver.io/docs/clioptions) 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:\n\n```js\nconst $button = await $('button')\nawait expect($button).toBeDisplayed()\n```\n\nSee more [Examples](docs/Examples.md)\n\n### Using in a standalone script\n\nIf you embed WebdriverIO in a standalone script, make sure you import `expect-webdriverio` before you use it anywhere.\n\n```js\nimport { remote } from 'webdriverio'\nimport { expect } from 'expect-webdriverio'\n\n;(async () =\u003e {\n    const browser = await remote({\n        capabilities: {\n            browserName: 'chrome'\n        }\n    })\n\n    await browser.url('https://webdriver.io')\n\n    const $button = await browser.$('button')\n    await expect($button).toBeDisplayed()\n    \n    await browser.deleteSession()\n})().catch(console.error)\n```\n\n## API\n\nPlease see [API doc](docs/API.md)\n\n## Error messages\n\nError messages are informative out of the box and contain:\n\n- full element selector, like `$('form').$('input')`\n- actual and expected values\n- highlight the difference (texts assertions)\n\n![toHaveText](/docs/img/errors/text.png?raw=true \"toHaveText\")\n![toHaveElementClass](/docs/img/errors/class.png?raw=true \"toHaveElementClass\")\n\n## What's next?\n\nFirst of all, **feel free to raise an issue with your suggestions or help with PR!**\n\n### Planned\n\n- css matcher\n- size matcher\n- cookie / localStorage matchers?\n- text regex matchers\n- multiremote support (if requested)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebdriverio%2Fexpect-webdriverio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebdriverio%2Fexpect-webdriverio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebdriverio%2Fexpect-webdriverio/lists"}