WebdriverIO

repository·main·Indexed 11 days ago

https://github.com/webdriverio/webdriverio

A Node.js-based automation framework for browser and mobile testing that supports WebDriver, WebDriver BiDi, and Appium protocols. It includes a test runner compatible with Mocha, Jasmine, and Cucumber, and supports multiremote sessions for interactive feature testing. The framework integrates with cloud services such as Sauce Labs, BrowserStack, Testingbot, and Kobiton, and supports the Page Object Pattern for maintainable test suites.

Tokens
356.8K
Snippets
1.2K
Records
1.5K
Agent score
95%

What's inside WebdriverIO

  1. Overview of Visual Testing capabilities

    main

    WebdriverIO provides image comparisons for screens, specific elements, or full pages. It supports:

    • Desktop browsers: Chrome, Firefox, Safari, and Microsoft Edge.
    • Mobile/Tablet browsers: Chrome on Android emulators, Safari on iOS Simulators, and real devices via Appium.
    • Native Apps: Android emulators, iOS Simulators, and real devices via Appium.
    • Hybrid apps: Via Appium.

    Key features include:

    • Saving or comparing screenshots against a baseline.
    • Automatically creating baselines when they are missing.
    • Blocking out custom regions or automatically excluding status/toolbars (mobile only).
    • Increasing element dimensions for screenshots.
    • Hiding text to improve stability and focus on layout.
    • Using different comparison methods and additional matchers.
    • Verifying keyboard tabbing support.
  2. Overview of WebdriverIO capabilities

    main

    WebdriverIO is a progressive automation framework designed to automate modern web, mobile, and desktop applications. It is built to be extendable via plugins, compatible with multiple automation protocols, and feature-rich to support scalable and stable test suites.

    Supported Automation Targets:

    • Modern Web Applications: Frameworks like React, Vue, Angular, and Svelte.
    • Mobile Applications: Hybrid or native apps running on emulators, simulators, or real devices.
    • Desktop Applications: Native desktop apps, such as those built with Electron.js.
    • Web Components: Unit or component testing directly in the browser.
  3. Overview of WebdriverIO core and ecosystem packages

    main

    WebdriverIO is a modular ecosystem composed of several specialized packages. The core functionality is provided by webdriver (W3C WebDriver bindings) and webdriverio (the automation framework), managed via the @wdio/cli. The ecosystem is categorized into several functional groups:

    • Core: The fundamental automation engine and CLI.
    • Helpers: Utilities for configuration (@wdio/config), logging (@wdio/logger), protocol information (@wdio/protocols), REPL interfaces (@wdio/repl), and global variable management (@wdio/globals).
    • Reporters: Plugins to format test results, including Allure, Concise, Dot, JUnit, Spec, and Sumologic.
    • Services: Tools to manage external dependencies like Appium, Lighthouse, or cloud providers like Sauce Labs and TestingBot.
    • DevTools Adapters: Tools to bring the WebdriverIO DevTools UI to other runners like Nightwatch.js or Selenium.
    • Runners: Execution engines like @wdio/local-runner for local tests or @wdio/browser-runner for unit/component tests in the browser.
    • Framework Adapters: Integration for testing frameworks such as Cucumber, Jasmine, and Mocha.
  4. Overview of DevTools debugging interface

    main

    DevTools is a browser-based debugging interface used for visualizing, controlling, and inspecting test executions in real-time. It is compatible with WebdriverIO, Nightwatch.js, and Selenium WebDriver (any runner) using a unified backend and UI.

    Key features include:

    • Selective Rerunning: Re-execute specific test cases or suites instantly.
    • Preserve & Rerun (Compare): Snapshot a failing test and perform a side-by-side diff of two runs aligned by command.
    • Visual Debugging: Live browser previews with automatic screenshots after every command.
    • Execution Tracking: Detailed command logs with timestamps and results.
    • Network & Console Monitoring: Inspection of API calls and JavaScript logs.
    • Code Navigation: Jump to test source files via TestLens.
    • Session Recording: Continuous .webm video recording per session.
    • Trace Mode: Headless capture that produces a portable trace.zip artifact for offline replay or agentic consumption.
  5. Overview of Percy visual testing in WebdriverIO

    main

    Percy is a visual testing and review platform that integrates with WebdriverIO to provide cross-browser visual testing for both websites and native mobile applications. It works by capturing screenshots during your test execution and comparing them against established baselines to detect visual regressions.

    Key features include:

    • Automatic Baseline Management: Percy manages baseline selection across different branches to ensure tests remain relevant.
    • Visual Diffing: When changes are detected, Percy highlights and groups differences for manual or automated review.
    • Cross-Platform Support: Supports visual testing for web applications and native mobile applications (via App Percy).
    • Workflow Integration: Integrates with version control systems like GitHub, GitLab, and Bitbucket to facilitate visual reviews within the development lifecycle.
  6. Overview of WebdriverIO

    main

    WebdriverIO is a next-gen browser and mobile automation test framework for Node.js. It is designed for end-to-end (e2e), unit, and component testing.

    Key capabilities include:

    • Automation Technologies: Supports WebDriver, WebDriver BiDi, and Appium for mobile automation.
    • Test Frameworks: Compatible with various BDD/TDD frameworks.
    • Execution Environments: Tests can be run locally or in the cloud via providers like Sauce Labs, BrowserStack, TestingBot, or TestMu AI (formerly LambdaTest).
  7. Features of the Nightwatch DevTools Adapter

    main

    The Nightwatch adapter provides a DevTools experience similar to WebdriverIO. Most features are captured automatically with a basic nightwatchDevtools({ port: 3000 }) setup:

    • Interactive Test Rerunning & Visualization: Live previews and one-click rerunning.
    • Preserve & Rerun (Compare): Side-by-side diffing of failed tests.
    • Multi-Framework Support: Supports Standard (mocha-style) and Cucumber/BDD.
    • Console Logs: Inspect browser console output (use bidi: true for real-time).
    • Network Logs: Monitor API calls (requires 'goog:loggingPrefs': { performance: 'ALL' } in setup).
    • Metadata: Session capabilities and environment timing.
    • TestLens: Jump from commands to source lines.
    • Session Screencast: Continuous .webm recording.
    • Trace Mode: Headless portable trace artifacts.
  8. Capabilities of WebdriverIO MCP

    main

    WebdriverIO MCP provides a unified interface for automating browsers, mobile apps, and cloud devices.

    Browser Automation

    • Session Management: Launch Chrome, Firefox, Edge, or Safari (headed/headless) and attach to existing Chrome instances via CDP.
    • Navigation: URL navigation and multi-tab management.
    • Interaction: Click, type, and find elements.
    • Analysis: Get interactable elements (with pagination) and the accessibility tree.
    • Screenshots: Capture auto-optimized screenshots (max 1MB).
    • Other: Scrolling, cookie management, device emulation (BiDi), and JavaScript execution.

    Mobile App Automation (iOS/Android)

    • Session Management: Launch apps on simulators, emulators, or real devices via Appium.
    • Gestures: Tap, swipe, and drag-and-drop.
    • Element Detection: Smart detection with multiple locator strategies and pagination.
    • App Lifecycle: Check app state (foreground, background, etc.).
    • Context Switching: Switch between native and webview contexts in hybrid apps.
    • Device Control: Rotation, keyboard control, and GPS override.
    • Other: Automatic permission/alert handling and Appium mobile command execution.

    Cloud Providers

    • Browser & Mobile Sessions: Support for BrowserStack, Sauce Labs, TestMu, and TestingBot.
    • App Management: Upload and list .apk/.ipa files.
    • Local Tunnel: Automatic management of provider-specific tunnel binaries.
    • Reporting: Tagging sessions with project/build/session labels.