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.$".
What this skill does
# WebdriverIO Automation Skill
## 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
```javascript
// ✅ 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)
```javascript
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
```javascript
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
```javascript
// 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
```javascript
// 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 |
Related in e2e-testing
playwright-skill
IncludedGenerates production-grade Playwright automation scripts and E2E tests in TypeScript, JavaScript, Python, Java, or C#. Supports local execution and TestMu AI cloud across 3000+ browser/OS combinations and real mobile devices. Use when the user asks to write Playwright tests, automate browsers, run cross-browser tests, test on real devices, debug flaky tests, mock APIs, or do visual regression. Triggers on: "Playwright", "E2E test", "browser test", "run on cloud", "cross-browser", "TestMu", "LambdaTest", "test my app", "test on mobile", "real device".
selenium-skill
IncludedGenerates production-grade Selenium WebDriver automation scripts and tests in Java, Python, JavaScript, C#, Ruby, or PHP. Supports local execution and TestMu AI cloud with 3000+ browser/OS combinations. Use when the user asks to write Selenium tests, automate with WebDriver, run cross-browser tests on Selenium Grid, or mentions "Selenium", "WebDriver", "RemoteWebDriver", "ChromeDriver", "GeckoDriver". Triggers on: "Selenium", "WebDriver", "browser automation", "Selenium Grid", "cross-browser", "TestMu", "LambdaTest".
cypress-skill
IncludedGenerates production-grade Cypress E2E and component tests in JavaScript or TypeScript. Supports local execution and TestMu AI cloud. Use when the user asks to write Cypress tests, set up Cypress, test with cy commands, or mentions "Cypress", "cy.visit", "cy.get", "cy.intercept". Triggers on: "Cypress", "cy.", "component test", "E2E test", "TestMu", "LambdaTest".
test-framework-migration-skill
IncludedMigrates and converts test automation scripts between Selenium, Playwright, Puppeteer, and Cypress. Use when the user asks to migrate, convert, or port tests from one framework to another; rewrite tests in a different framework; or switch from Selenium to Playwright, Playwright to Selenium, Puppeteer to Playwright, Cypress to Playwright, or vice versa. Triggers on: "migrate", "convert", "port", "selenium to playwright", "playwright to selenium", "puppeteer to playwright", "cypress to playwright", "rewrite tests in", "switch from [framework] to [framework]".
robot-framework-skill
IncludedGenerates Robot Framework tests in keyword-driven syntax with Python. Supports SeleniumLibrary, RequestsLibrary, and custom keywords. Use when user mentions "Robot Framework", "*** Test Cases ***", "SeleniumLibrary", ".robot file". Triggers on: "Robot Framework", "*** Test Cases ***", ".robot", "SeleniumLibrary", "keyword-driven test".
laravel-dusk-skill
IncludedGenerates Laravel Dusk browser tests in PHP. Chrome-based E2E testing for Laravel apps. Use when user mentions "Dusk", "Laravel Dusk", "$browser->visit", "DuskTestCase". Triggers on: "Laravel Dusk", "Dusk test", "$browser->visit", "DuskTestCase".