WebdriverIO Documentation

website·Indexed 40 days ago

https://webdriver.io/docs/gettingstarted/

Documentation for WebdriverIO, a browser and mobile automation framework. Includes guides on events, Appium integration for mobile testing, accessibility testing with Axe Core and TestMu AI, and details on the v9 release.

Tokens
292.2K
Snippets
1.7K
Records
2.2K
Agent score
73%

What's inside WebdriverIO

  1. Overview of tauri-plugin-wdio capabilities

    The tauri-plugin-wdio is a required plugin that enables the following capabilities for WebdriverIO testing of Tauri applications:

    • Execute API: Run JavaScript code from tests with access to Tauri APIs.
    • Mocking Support: Mock Tauri backend commands for isolated testing.
    • Log Forwarding: Capture console logs from both frontend and backend.
    • Invoke Interception: Enable mocking without modifying backend commands.
  2. Overview of Percy visual testing

    Percy is a visual testing and review platform that integrates with WebdriverIO to capture screenshots and compare them against baselines to detect visual regressions. It supports both web applications and native mobile applications (via App Percy).
  3. Overview of Dioxus Browser Mode

    Browser mode is a frontend-only test mode for Dioxus that allows testing the UI in Chrome against a running dev server. It replaces the Dioxus Rust backend with mocks defined per command, intercepting the Dioxus invoke(...) API at the JavaScript boundary. This eliminates the need for a Dioxus binary, driver, or Rust compilation during tests, enabling fast feedback and the use of standard Chrome DevTools and HMR.

    Use Browser Mode when:

    • Asserting UI state.
    • Verifying that components call correct Dioxus commands with specific arguments.
    • Checking how the renderer handles mock responses.

    Do NOT use Browser Mode (use Native Mode instead) when:

    • You need to call browser.dioxus.execute() to access the bridge.
    • You need to manage windows via browser.dioxus.switchWindow() or browser.dioxus.listWindows().
    • You need to use browser.dioxus.triggerDeeplink().
    • You need to assert on real command round-trips to a running Rust backend.
  4. Overview of the wdio-dioxus-bridge

    The wdio-dioxus-bridge is a required Rust crate that enables WebdriverIO testing of Dioxus desktop applications. It functions as a plain Rust crate (not a plugin) that integrates into the Dioxus desktop::Config. It provides several key capabilities:

    • Execute API: Run JavaScript from tests with access to Dioxus IPC (invoke).
    • Mocking Support: Mock Dioxus backend commands for isolated testing.
    • Log Forwarding: Capture console logs from both the frontend webview and Rust backend.
    • Invoke Interception: Enable mocking without modifying backend command handlers.
    • Embedded WebDriver Server: Automatically wired in to facilitate communication via a wdio:// custom protocol.
  5. Overview of DevTools Service Features

    The DevTools (Test Debugging & Visualization) Service provides a suite of tools for interactive test execution and debugging across WebdriverIO, Selenium, and Nightwatch.js. Key capabilities include:

    • Interactive Execution: Selective test reruns (via play buttons), smart browser reuse (no new tabs), and the ability to stop execution with proper cleanup.
    • Real-Time Visualization: Live browser previews in a scaled iframe, a command-by-command actions timeline, and a nested test hierarchy tree.
    • Debugging Tools: Detailed WebDriver command logging, automatic screenshots after each command, source code mapping to the triggering line, and capture of application console and network logs.
    • Execution Controls: Global state management to prevent conflicting runs and automatic clearing of execution data on reruns.
  6. Overview of WebdriverIO Visual Testing

    The @wdio/visual-service is a lightweight service for image comparison of screens, elements, or full pages. It supports desktop browsers, mobile/tablet browsers via Appium, native apps, and hybrid apps. It uses Pixelmatch for perceptual image comparison (YIQ color space) and fast-png for PNG processing. Key capabilities include:

    • Saving or comparing screens/elements against a baseline.
    • Automatic baseline creation.
    • Blocking out custom regions or excluding mobile status/toolbars.
    • Hiding text to focus on layout and improve stability.
    • Support for native apps using saveScreen, saveElement, checkScreen, checkElement, and matchers toMatchScreenSnapshot and toMatchElementSnapshot.
  7. Overview of @wdio/ocr-service for OCR Testing

    The @wdio/ocr-service provides a set of custom commands for WebdriverIO to interact with mobile native apps and desktop sites where elements lack unique identifiers. It uses Tesseract.js/Tesseract for Optical Character Recognition (OCR) and Fuse.js for fuzzy string matching to find elements based on visible text. The service works by taking a screenshot, optimizing it for contrast (black/white), and extracting text. It requires zero system dependencies by default but can be optimized with a local Tesseract installation.
  8. Overview of WebdriverIO MCP

    WebdriverIO MCP is a Model Context Protocol (MCP) server that enables AI assistants to automate and interact with web browsers (Chrome, Firefox, Edge, Safari) and mobile applications (iOS and Android native/hybrid apps via Appium). It supports local execution as well as cloud devices via BrowserStack, Sauce Labs, TestMu, and TestingBot. Key capabilities include smart element detection, automated screenshot optimization, session management, and context switching for hybrid apps.
  9. Overview of WebdriverIO automation capabilities

    WebdriverIO is a progressive automation framework designed for modern web and mobile applications. It supports the following automation targets:

    • Modern web applications (React, Vue, Angular, Svelte, etc.)
    • Hybrid or native mobile applications (emulators, simulators, or real devices)
    • Native desktop applications (e.g., Electron.js)
    • Unit or component testing of web components in the browser
  10. Overview of DevTools for WebdriverIO, Nightwatch, and Selenium

    DevTools is a browser-based debugging interface for visualizing, controlling, and inspecting test executions in real-time. It is compatible with WebdriverIO, Nightwatch.js, and Selenium WebDriver. Key capabilities include:

    • Selective test rerunning and side-by-side comparison of failing tests.
    • Visual debugging with live browser previews and automatic screenshots.
    • Detailed command logs with timestamps and results.
    • Network and console monitoring (API calls and JS logs).
    • Direct navigation to test source files via TestLens.
    • Session recording in .webm format.
    • Trace mode: Headless capture producing a trace.zip artifact for offline replay.
  11. Overview of @wdio/electron-service

    @wdio/electron-service is a WebdriverIO service designed for cross-platform E2E testing of Electron applications. It serves as a successor to Spectron and provides features such as automatic Chromedriver setup (for Electron v26+), automatic path detection for Electron Forge and Electron Builder, access and mocking of Electron APIs, deeplink testing, and console log capture from both main and renderer processes.