Webdriverio Skill

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.$".

Published by @LambdaTest·from LambdaTest/agent-skills·0 agent reads / 30d·0 saves·

WebdriverIO Automation Skill

Step 1 — Execution Target

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

Step 2 — Framework

SignalRunner
DefaultMocha
"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('[email protected]');

// 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('[email protected]');
        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

TaskCommand
Setupnpm init wdio@latest
Run allnpx wdio run wdio.conf.js
Run specificnpx wdio run wdio.conf.js --spec ./test/login.js
Run suitenpx wdio run wdio.conf.js --suite smoke
ParallelSet maxInstances: 5 in config
Screenshotawait browser.saveScreenshot('./screenshot.png')

Reference Files

FileWhen to Read
reference/cloud-integration.mdLambdaTest service, parallel, capabilities
reference/advanced-patterns.mdCustom commands, reporters, services

Deep Patterns → reference/playbook.md

§SectionLines
1Production ConfigurationMulti-env, multi-browser configs
2Page Object ModelBasePage, LoginPage, DashboardPage
3Custom CommandsBrowser + element commands, TypeScript
4Network MockingDevTools mock, abort, error simulation
5File OperationsUpload, download, drag & drop
6Multi-Tab, iFrame & Shadow DOMWindow handles, nested shadow
7Visual RegressionImage comparison service
8API TestingFetch-based, API+UI combined
9Mobile TestingAppium service integration
10LambdaTest IntegrationCloud grid config
11CI/CD IntegrationGitHub Actions, Docker Compose
12Debugging Quick-Reference11 common problems
13Best Practices Checklist14 items

Bundled with this artifact

3 files

Reference files that ship alongside this artifact. Agents pull these in only when the task needs them.

More on the bench

SKILL0

Skill Creator

Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.

ai-prompt-engineering+1
6
SKILL0

Bash Pro

Master of defensive Bash scripting for production automation, CI/CD pipelines, and system utilities. Expert in safe, portable, and testable shell scripts.

ai-prompt-engineering+3
4
SKILL0

Documentation

Creates, structures, and reviews technical documentation following the Diátaxis framework (tutorials, how-to guides, reference, and explanation pages). Use when a user needs to write or reorganize docs, structure a tutorial vs. a how-to guide, build reference docs or API documentation, create explanation pages, choose between Diátaxis documentation types, or improve existing documentation structure. Trigger terms include: documentation structure, Diátaxis, tutorials vs how-to guides, organize docs, user guide, reference docs, technical writing.

software-engineering
4