All Projects → webdriverio → expect-webdriverio

webdriverio / expect-webdriverio

Licence: MIT License
WebdriverIO Assertion Library

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to expect-webdriverio

fluentcheck
Fluent assertions for Python
Stars: ✭ 79 (+61.22%)
Mutual labels:  assertion-library
html-dnd
HTML Drag and Drop Simulator for E2E testing
Stars: ✭ 53 (+8.16%)
Mutual labels:  webdriverio
expectest
Crate provides matchers and matcher functions for unit testing.
Stars: ✭ 25 (-48.98%)
Mutual labels:  expect
ui-testing-book
Content for "The Web App Testing Guidebook"
Stars: ✭ 26 (-46.94%)
Mutual labels:  webdriverio
wdio-reportportal-reporter
A WebdriverIO plugin. Report results to Report Portal.
Stars: ✭ 22 (-55.1%)
Mutual labels:  webdriverio
percy-webdriverio
Visual testing with WebdriverIO and Percy
Stars: ✭ 25 (-48.98%)
Mutual labels:  webdriverio
sexpect
Expect for Shells
Stars: ✭ 99 (+102.04%)
Mutual labels:  expect
wdi5
cross-platform test framework for UI5 web-apps. wdi5 = Webdriver.IO + UI5 Test API
Stars: ✭ 45 (-8.16%)
Mutual labels:  webdriverio
beJS
Simple, light-weight assertions framework for javascript
Stars: ✭ 12 (-75.51%)
Mutual labels:  assertion-library
ansible-cups
Ansible role to install and configure CUPS, assist with installing PPDs and install printers/classes
Stars: ✭ 20 (-59.18%)
Mutual labels:  expect
webdriverio-zap-proxy
Demo - how to easily build security testing for Web App, using Zap and Glue
Stars: ✭ 58 (+18.37%)
Mutual labels:  webdriverio
wdio-junit-reporter
A WebdriverIO v4 plugin. Report results in junit xml format.
Stars: ✭ 13 (-73.47%)
Mutual labels:  webdriverio
wdio-spec-reporter
A WebdriverIO v4 plugin. Reporter that creates 'spec'-style reports
Stars: ✭ 20 (-59.18%)
Mutual labels:  webdriverio
playwright-jest-examples
Demonstrates the usage of Playwright (cross-browser automation library in Node.js) in combination with Jest on GitHub Actions to test various setups.
Stars: ✭ 79 (+61.22%)
Mutual labels:  expect
phpunit-expect
BDD-style assertions for PHPUnit
Stars: ✭ 15 (-69.39%)
Mutual labels:  expect
nim-contra
Lightweight Self-Documenting Design by Contract Programming and Security Hardened mode.
Stars: ✭ 46 (-6.12%)
Mutual labels:  assertion-library
wdio-jasmine-framework
A WebdriverIO v4 plugin. Adapter for Jasmine testing framework.
Stars: ✭ 22 (-55.1%)
Mutual labels:  webdriverio
gulp-webdriver
gulp-webdriver is a gulp plugin to run selenium tests with the WebdriverIO testrunner
Stars: ✭ 77 (+57.14%)
Mutual labels:  webdriverio
Buoy
A complement to Pharo
Stars: ✭ 18 (-63.27%)
Mutual labels:  assertion-library
demo-webdriverio-cucumber
E2E Tests with WebdriverIO and Cucumber
Stars: ✭ 28 (-42.86%)
Mutual labels:  webdriverio

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 v5.16.11 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.

const { remote } = require('webdriverio');
require('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)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].