Skill

Write WebdriverIO tests with AI coding assistants

Generates WebdriverIO browser automation tests in JS/TS, local or on TestMu AI cloud, with page objects and wait strategies.

Works with webdriveriogithubseleniumplaywrightcypress

35
Spark score
out of 100
Updated last month
Version 1.0.0

Add to Favorites

Why it matters

Enable AI coding assistants to generate production-grade WebdriverIO test automation code that runs on TestMu AI's cloud infrastructure across 10K+ real devices and 3,000+ browsers, eliminating the need to manually write browser automation tests.

Outcomes

What it gets done

01

Generate WebdriverIO test scripts through natural language prompts to AI assistants

02

Execute cross-browser tests on TestMu AI cloud with Chrome, Firefox, and other browsers

03

Configure TestMu AI tunnel capabilities for testing locally hosted applications

04

Integrate WebdriverIO tests with CI/CD pipelines and view results on TestMu AI dashboard

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/ag-webdriverio-skill | bash

Overview

WebdriverIO Automation Skill

This skill generates WebdriverIO browser automation tests in JavaScript or TypeScript - selectors, page objects, wait strategies, and cloud-grid configuration for TestMu AI/LambdaTest - picking the test runner from cues in the request. Use it whenever WebdriverIO, WDIO, or WDIO-style selectors are mentioned and browser automation tests need generating, local or on a cloud grid - it's scoped specifically to WebdriverIO conventions.

What it does

Generates WebdriverIO (WDIO) browser automation tests in JavaScript or TypeScript, targeting either a local Selenium/DevTools setup or TestMu AI's cloud grid (LambdaTest service), and picking a test runner based on cues in the request - Mocha by default, Jasmine or Cucumber/BDD when explicitly mentioned.

describe('Login', () => {
    it('should login successfully', async () => {
        await browser.url('/login');
        await $('[data-testid="email"]').setValue('user@test.com');
        await $('[data-testid="password"]').setValue('password123');
        await $('[data-testid="submit"]').click();
        await expect(browser).toHaveUrl(expect.stringContaining('/dashboard'));
    });
});

Core selector patterns favor data-testid attributes ($('[data-testid="submit"]')), accessibility selectors ($('aria/Submit')), and text-based selectors ($('button=Submit')), with chaining ($('form').$('input[name="email"]')) and multi-element queries ($$('.list-item')). Page objects are generated as classes with getter-based element accessors and action methods, exported as a singleton instance. For TestMu AI cloud runs, a wdio.conf.js is generated with LT_USERNAME/LT_ACCESS_KEY env vars, the LambdaTest hub hostname, the lambdatest service, and capabilities including platform, build/test name, and video/network capture. Wait strategies cover explicit element waits (waitForDisplayed({ timeout })) and condition polling (browser.waitUntil with a timeout and message).

A quick-reference command table covers setup (npm init wdio@latest), running all or specific specs/suites (npx wdio run wdio.conf.js --spec ... / --suite ...), parallel execution (maxInstances in config), and screenshots (browser.saveScreenshot). Two reference files extend the core skill on demand: reference/cloud-integration.md (LambdaTest service, parallel runs, capabilities) and reference/advanced-patterns.md (custom commands, reporters, services). A deeper reference/playbook.md covers thirteen additional sections: production multi-env/multi-browser configuration, the full Page Object Model (BasePage/LoginPage/DashboardPage), custom browser and element commands in TypeScript, network mocking (DevTools mock/abort/error simulation), file operations (upload/download/drag-and-drop), multi-tab/iframe/shadow-DOM handling, visual regression via image comparison, API testing (fetch-based and combined API+UI), mobile testing via the Appium service, LambdaTest cloud-grid integration, CI/CD integration (GitHub Actions, Docker Compose), an 11-item debugging quick-reference, and a 14-item best-practices checklist.

When to use - and when NOT to

Use it whenever WebdriverIO, WDIO, wdio.conf, or WDIO-style selectors (browser.url, $, $$) are mentioned and browser automation tests need generating - local or against TestMu AI's cloud grid. It's scoped specifically to WebdriverIO conventions, not other automation frameworks like Playwright or Cypress.

Inputs and outputs

Input is a description of the browser flow to test, plus optional signals for execution target (local/cloud) and test framework (Mocha/Jasmine/Cucumber). Output is WebdriverIO test code (spec files, page objects, or config), pointing to deeper reference files for advanced patterns as needed.

Integrations

Built on WebdriverIO with TestMu AI/LambdaTest cloud-grid integration for cross-browser execution, and referenced integrations spanning Appium (mobile), GitHub Actions/Docker Compose (CI/CD), and visual-regression/network-mocking services.

Who it's for

Teams already committed to WebdriverIO over Playwright or Cypress - especially ones running on TestMu AI's cloud grid - who want the AI to reach for the project's actual conventions (data-testid selectors, the established page-object shape, the right reference file for an advanced pattern) instead of generating generic Selenium-style code that has to be rewritten to fit.

Source README

WebdriverIO Automation Skill

When to Use

Use this skill when you need generates WebdriverIO (WDIO) automation tests in JavaScript or TypeScript. Supports local and TestMu AI cloud. Use when user mentions "WebdriverIO", "WDIO", "wdio.conf", "browser.url", "$", "$$". Triggers on: "WebdriverIO", "WDIO", "wdio", "browser.$".

Step 1 - Execution Target

Default local. If mentions "cloud", "TestMu", "LambdaTest" → cloud via WDIO LambdaTest service.

Step 2 - Framework

Signal Runner
Default Mocha
"Jasmine" Jasmine
"Cucumber", "BDD" Cucumber

Core Patterns

Selectors

// ✅ Preferred
await $('[data-testid="submit"]').click();
await $('aria/Submit').click();
await $('button=Submit').click(); // text-based

// Chaining
await $('form').$('input[name="email"]').setValue('test@test.com');

// Multiple elements
const items = await $$('.list-item');

Basic Test (Mocha)

describe('Login', () => {
    it('should login successfully', async () => {
        await browser.url('/login');
        await $('[data-testid="email"]').setValue('user@test.com');
        await $('[data-testid="password"]').setValue('password123');
        await $('[data-testid="submit"]').click();
        await expect(browser).toHaveUrl(expect.stringContaining('/dashboard'));
    });
});

Page Object

class LoginPage {
    get inputEmail() { return $('[data-testid="email"]'); }
    get inputPassword() { return $('[data-testid="password"]'); }
    get btnSubmit() { return $('[data-testid="submit"]'); }

    async login(email, password) {
        await this.inputEmail.setValue(email);
        await this.inputPassword.setValue(password);
        await this.btnSubmit.click();
    }
}
module.exports = new LoginPage();

TestMu AI Cloud Config

// wdio.conf.js
exports.config = {
    user: process.env.LT_USERNAME,
    key: process.env.LT_ACCESS_KEY,
    hostname: 'hub.lambdatest.com',
    port: 80,
    path: '/wd/hub',
    services: ['lambdatest'],
    capabilities: [{
        browserName: 'Chrome',
        browserVersion: 'latest',
        'LT:Options': {
            platform: 'Windows 11',
            build: 'WDIO Build',
            name: 'WDIO Test',
            video: true,
            network: true,
        }
    }],
};

Wait Strategies

// Wait for element
await $('[data-testid="result"]').waitForDisplayed({ timeout: 10000 });

// Wait for condition
await browser.waitUntil(
    async () => (await $('[data-testid="count"]').getText()) === '5',
    { timeout: 10000, timeoutMsg: 'Count did not reach 5' }
);

Quick Reference

Task Command
Setup npm init wdio@latest
Run all npx wdio run wdio.conf.js
Run specific npx wdio run wdio.conf.js --spec ./test/login.js
Run suite npx wdio run wdio.conf.js --suite smoke
Parallel Set maxInstances: 5 in config
Screenshot await browser.saveScreenshot('./screenshot.png')

Reference Files

File When to Read
reference/cloud-integration.md LambdaTest service, parallel, capabilities
reference/advanced-patterns.md Custom commands, reporters, services

Deep Patterns → reference/playbook.md

§ Section Lines
1 Production Configuration Multi-env, multi-browser configs
2 Page Object Model BasePage, LoginPage, DashboardPage
3 Custom Commands Browser + element commands, TypeScript
4 Network Mocking DevTools mock, abort, error simulation
5 File Operations Upload, download, drag & drop
6 Multi-Tab, iFrame & Shadow DOM Window handles, nested shadow
7 Visual Regression Image comparison service
8 API Testing Fetch-based, API+UI combined
9 Mobile Testing Appium service integration
10 LambdaTest Integration Cloud grid config
11 CI/CD Integration GitHub Actions, Docker Compose
12 Debugging Quick-Reference 11 common problems
13 Best Practices Checklist 14 items

Limitations

  • Use this skill only when the task clearly matches its upstream source and local project context.
  • Verify commands, generated code, dependencies, credentials, and external service behavior before applying changes.
  • Do not treat examples as a substitute for environment-specific tests, security review, or user approval for destructive or costly actions.

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.