webdriverio-testing
БесплатноБез исполняемых скриптовНе проверенUse for any question or task about WebdriverIO, including converting Selenium code to WDIO and one runner for web and Appium mobile tests: npm init wdio…
от testland★ 18 звёзд на GitHubОб этом скилле
webdriverio-testing
Overview
WebdriverIO (wdio) is a JavaScript / TypeScript E2E framework built on the W3C WebDriver protocol. It differentiates from Selenium by:
- Modern JS/TS API.
- Service architecture (browserstack, sauce, appium, devtools).
- Built-in framework integrations (Mocha, Jasmine, Cucumber).
- Multi-protocol support (WebDriver classic, WebDriver Bidi, Chrome DevTools Protocol).
When to use
- A JS/TS project wants WebDriver-protocol compatibility (legacy systems / device farms).
- Service-based architecture matters (BrowserStack / Sauce Labs via wdio services is clean).
- Team already on Mocha or Jasmine; wants Cucumber-style BDD via wdio-cucumber-framework.
- Cross-platform via Appium service (mobile + web in one runner).
For pure-modern E2E, Playwright is simpler. For non-WebDriver architecture, Cypress.
Step 1 - Scaffold
npm init wdio@latest
Interactive prompts pick:
- Test runner type (E2E for browsers, mobile via appium).
- Framework (Mocha / Jasmine / Cucumber).
- Reporters (spec, allure, junit, etc.).
- Services (browserstack, sauce, appium, devtools, ...).
- Browser(s) to test.
What lands: wdio.conf.ts + tests/specs/*.e2e.ts +
package.json updates.
Step 2 - Configure
// wdio.conf.ts
export const config: WebdriverIO.Config = {
runner: 'local',
specs: ['./tests/specs/**/*.e2e.ts'],
exclude: [],
maxInstances: 4,
capabilities: [
{
browserName: 'chrome',
'goog:chromeOptions': { args: ['--headless=new'] },
},
{
browserName: 'firefox',
'moz:firefoxOptions': { args: ['-headless'] },
},
],
baseUrl: 'http://localhost:3000',
services: ['chromedriver', 'geckodriver'],
framework: 'mocha',
reporters: ['spec', ['junit', { outputDir: 'reports/junit' }]],
mochaOpts: { ui: 'bdd', timeout: 30000 },
};
maxInstances: 4 runs 4 specs in parallel.
Step 3 - Author a test (Mocha)
// tests/specs/checkout.e2e.ts
import { browser, $ } from '@wdio/globals';
import { expect } from 'chai';
describe('Checkout flow', () => {
beforeEach(async () => {
await browser.url('/login');
await $('[data-testid=email]').setValue('[email protected]');
await $('[data-testid=password]').setValue('pwd');
await $('button[type=submit]').click();
await expect($('h1=Welcome')).toBeDisplayed();
});
it('completes checkout', async () => {
await browser.url('/products/BOOK-001');
await $('[data-testid=add-to-cart]').click();
await expect($('[data-testid=cart-count]')).toHaveText('1');
await browser.url('/checkout');
await $('[name=card]').setValue('4242 4242 4242 4242');
await $('button=Place order').click();
await expect($('h1=Order confirmed')).toBeDisplayed();
});
});
The $ selector returns a wdio element (Promise-wrapped); methods
auto-wait. WDIO selectors have shortcuts:
$('h1=Welcome')- text equals$('h1*=Welcome')- text contains$('[data-testid=foo]')- CSS selector$('//button[@type="submit"]')- XPath
Step 4 - Services
services: [
// Local browser drivers
'chromedriver',
'geckodriver',
// Cloud device farms
['browserstack', { user: 'USER', key: 'KEY' }],
['sauce', { user: 'USER', key: 'KEY' }],
// Mobile
['appium', { command: 'appium', args: { port: 4723 } }],
// DevTools (Puppeteer-style fast browser)
'devtools',
];
Services handle setup / teardown; tests connect via the configured capability.
Step 5 - Run
# Run all specs
npx wdio run wdio.conf.ts
# Specific spec
npx wdio run wdio.conf.ts --spec ./tests/specs/checkout.e2e.ts
# Watch mode
npx wdio run wdio.conf.ts --watch
Step 6 - Cucumber framework (BDD)
// wdio.conf.ts
framework: 'cucumber',
specs: ['./features/**/*.feature'],
cucumberOpts: {
require: ['./features/step-definitions/**/*.ts'],
backtrace: false,
requireModule: ['ts-node/register'],
timeout: 60000,
},
# features/checkout.feature
Feature: Checkout
Scenario: Complete a successful checkout
Given I am logged in as "[email protected]"
When I add "BOOK-001" to my cart
And I complete checkout
Then I see the order confirmation
// features/step-definitions/checkout.steps.ts
import { Given, When, Then } from '@wdio/cucumber-framework';
import { $ } from '@wdio/globals';
Given(/^I am logged in as "(.+)"$/, async (email) => {
await browser.url('/login');
await $('[data-testid=email]').setValue(email);
await $('[data-testid=password]').setValue('pwd');
await $('button[type=submit]').click();
});
// ... etc.
Pairs with cucumber-testing (in the qa-bdd plugin)
conventions for the Gherkin layer.
Step 7 - CI integration
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
with: { node-version: '22' }
- run: npm ci
- run: npx wdio run wdio.c
Установить webdriverio-testing в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл webdriverio-testing?
Use for any question or task about WebdriverIO, including converting Selenium code to WDIO and one runner for web and Appium mobile tests: npm init wdio scaffolding, services for Sauce Labs, BrowserStack, Appium and DevTools, spec, Allure and JUnit reporters, and Mocha, Jasmine or Cucumber frameworks.
Как установить скилл webdriverio-testing?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл webdriverio-testing запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic