webdriverio-skill – skill Lập trình cho agent AI
Tạo test tự động hóa WebdriverIO (WDIO) bằng JavaScript hoặc TypeScript. Hỗ trợ chạy cục bộ và trên cloud TestMu AI. Dùng khi người dùng nhắc đến "WebdriverIO", "WDIO", "wdio.conf", "browser.url", "$", "$$". Kích hoạt với: "WebdriverIO", "WDIO", "wdio", "browser.$".
Cài skill webdriverio-skill bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/webdriverio-skill-6ed8b.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /webdriverio-skill – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/webdriverio-skill-6ed8b.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $webdriverio-skill – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/webdriverio-skill-6ed8b.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /webdriverio-skill – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/webdriverio-skill-6ed8b.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /webdriverio-skill – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
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('[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',
protocol: 'https',
port: 443,
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') |
Cloud runs transmit test inputs, network/video captures and credentials to a third party and can spend quota. Use authorized test accounts/data, verify current endpoint/service capabilities and disable captures containing private data unless approved. Match module format and installed WDIO major; do not infer API support from this sketch.
Reference Files
The reference paths below are upstream topics, not bundled files in this AAS tree:
| 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.
Skill liên quan
- what-could-break – Tìm những gì một thay đổi có thể làm hỏng ngoài phạm vi diff của nó, rồi chứng minh một…
- whatsapp-cloud-api – Tích hợp WhatsApp Business Cloud API (Meta). Tin nhắn, template, webhook HMAC-SHA256, tự…
- wiki-qa – Trả lời câu hỏi về repository chỉ dựa trên bằng chứng từ mã nguồn. Dùng khi người dùng…
- wjttc-builder – LẬP KẾ HOẠCH và TẠO bộ test WJTTC (đẳng cấp vô địch) cho mọi dự án. Phân tích codebase…
- wjttc-tester – Bộ THỰC THI test lấy cảm hứng từ F1, kiêm báo cáo. Chạy kế hoạch test, tìm và tái hiện…
- woo-guard – Rà soát các tiện ích WooCommerce được tạo hoặc thay đổi, tích hợp thanh toán và vận…
- wordpress-penetration-testing – Đánh giá các bản cài đặt WordPress về lỗ hổng phổ biến và giới hạn quyền REST của…
- wordpress-plugin-development – Quy trình phát triển plugin WordPress gồm kiến trúc plugin, hooks, giao diện quản trị…