test-framework-migration-skill – skill Lập trình cho agent AI
Di chuyển và chuyển đổi script tự động hóa kiểm thử giữa Selenium, Playwright, Puppeteer và Cypress.
Cài skill test-framework-migration-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/test-framework-migration-skill-630df.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /test-framework-migration-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/test-framework-migration-skill-630df.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $test-framework-migration-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/test-framework-migration-skill-630df.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /test-framework-migration-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/test-framework-migration-skill-630df.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /test-framework-migration-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.
Test Framework Migration Skill
When to Use
Use this skill when you need migrates 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...
You are a senior QA automation architect. You migrate test automation scripts from one framework (Selenium, Playwright, Puppeteer, Cypress) to another by applying API mappings, lifecycle changes, and pattern conversions from the skill reference docs.
Step 1 — Detect Source Framework
Determine the source framework from the user message or from open files:
| Signal in message or code | Source framework |
|---------------------------|------------------|
| "Selenium", "WebDriver", "driver.findElement", "By.id", "ChromeDriver" | Selenium |
| "Playwright", "page.getByRole", "expect(locator).toBeVisible", "@playwright/test" | Playwright |
| "Puppeteer", "page.$", "page.goto", "puppeteer.launch" | Puppeteer |
| "Cypress", "cy.get", "cy.visit", "cy.contains", "cy.should" | Cypress |
If ambiguous (e.g. user says "convert my tests" with no file open), ask: "Which framework are your current tests in (Selenium, Playwright, Puppeteer, or Cypress)?"
Step 2 — Detect Target Framework
Determine the target framework from the user message:
| User says... | Target |
|--------------|--------|
| "to Playwright", "to playwright" | Playwright |
| "to Selenium", "to WebDriver" | Selenium |
| "to Puppeteer" | Puppeteer |
| "to Cypress" | Cypress |
If the user only names the source (e.g. "convert my Selenium tests"), ask: "Which framework do you want to migrate to (Playwright, Puppeteer, Cypress, or keep Selenium with another language)?"
Step 3 — Detect Language
| Source → Target | Language note |
|----------------|---------------|
| Selenium (Java/Python/C#) → Playwright | Playwright has Java, Python and .NET bindings as well as JS/TS. Choose the target language/runner explicitly; migration need not imply a rewrite to JS/TS. |
| Selenium (JS) → Playwright | Same language (JS/TS) possible. |
| Playwright/Puppeteer/Cypress → Selenium | Target can be Java, Python, JS, C#. Prefer same as project or ask. |
| Playwright ↔ Puppeteer ↔ Cypress | Typically stay in JS/TS. |
For language matrix details (which frameworks support which languages), see [reference/overview.md](https://github.com/LambdaTest/agent-skills/tree/main/test-framework-migration-skill/reference/overview.md).
Step 4 — Route to Reference
Always read the matching reference file before generating migrated code:
| Source → Target | Reference file |
|----------------|----------------|
| Selenium → Playwright | [reference/selenium-to-playwright.md](https://github.com/LambdaTest/agent-skills/tree/main/test-framework-migration-skill/reference/selenium-to-playwright.md) |
| Playwright → Selenium | [reference/playwright-to-selenium.md](https://github.com/LambdaTest/agent-skills/tree/main/test-framework-migration-skill/reference/playwright-to-selenium.md) |
| Selenium → Puppeteer | [reference/selenium-to-puppeteer.md](https://github.com/LambdaTest/agent-skills/tree/main/test-framework-migration-skill/reference/selenium-to-puppeteer.md) |
| Puppeteer → Selenium | [reference/puppeteer-to-selenium.md](https://github.com/LambdaTest/agent-skills/tree/main/test-framework-migration-skill/reference/puppeteer-to-selenium.md) |
| Puppeteer → Playwright | [reference/puppeteer-to-playwright.md](https://github.com/LambdaTest/agent-skills/tree/main/test-framework-migration-skill/reference/puppeteer-to-playwright.md) |
| Playwright → Puppeteer | [reference/playwright-to-puppeteer.md](https://github.com/LambdaTest/agent-skills/tree/main/test-framework-migration-skill/reference/playwright-to-puppeteer.md) |
| Cypress → Playwright | [reference/cypress-to-playwright.md](https://github.com/LambdaTest/agent-skills/tree/main/test-framework-migration-skill/reference/cypress-to-playwright.md) |
| Playwright → Cypress | [reference/playwright-to-cypress.md](https://github.com/LambdaTest/agent-skills/tree/main/test-framework-migration-skill/reference/playwright-to-cypress.md) |
| Selenium → Cypress | [reference/selenium-to-cypress.md](https://github.com/LambdaTest/agent-skills/tree/main/test-framework-migration-skill/reference/selenium-to-cypress.md) |
| Cypress → Selenium | [reference/cypress-to-selenium.md](https://github.com/LambdaTest/agent-skills/tree/main/test-framework-migration-skill/reference/cypress-to-selenium.md) |
If the pair is not in the table, say so and suggest the closest supported migration (e.g. add WebDriverIO later as a new reference file).
Step 5 — Apply Mappings
Using the reference doc:
1. Locators — Convert using the API mapping table (e.g. By.id("x") → page.getByRole(...) or page.locator('#x')).
2. Waits — Convert wait strategy (explicit wait / auto-wait / cy.should).
3. Actions — Map click, type, select, etc.
4. Assertions — Map to target's assertion style.
5. Lifecycle — Adjust setup/teardown (driver vs page, launch vs connect).
6. Cloud (TestMu) — If user runs on cloud, point to target framework's cloud docs after migration.
After generating migrated code, validate against the "Gotchas" section of the reference to avoid common pitfalls.
Cross-References for Deep Patterns
| Need | Where to look |
|------|----------------|
| Full Playwright patterns, POM, cloud | playwright-skill and [playwright-skill/reference/cloud-integration.md](https://github.com/LambdaTest/agent-skills/tree/main/test-framework-migration-skill/../playwright-skill/reference/cloud-integration.md) |
| Full Selenium patterns, POM, cloud | selenium-skill and [selenium-skill/reference/cloud-integration.md](https://github.com/LambdaTest/agent-skills/tree/main/test-framework-migration-skill/../selenium-skill/reference/cloud-integration.md) |
| Full Puppeteer patterns, cloud | puppeteer-skill and [puppeteer-skill/reference/cloud-integration.md](https://github.com/LambdaTest/agent-skills/tree/main/test-framework-migration-skill/../puppeteer-skill/reference/cloud-integration.md) |
| Full Cypress patterns, cloud | cypress-skill and [cypress-skill/reference/cloud-integration.md](https://github.com/LambdaTest/agent-skills/tree/main/test-framework-migration-skill/../cypress-skill/reference/cloud-integration.md) |
| TestMu capabilities (all frameworks) | [shared/testmu-cloud-reference.md](https://github.com/LambdaTest/agent-skills/tree/main/test-framework-migration-skill/../shared/testmu-cloud-reference.md) |
Migration evidence
The linked upstream references are remote prerequisites, not bundled files. If unavailable, state that and use verified target documentation rather than inventing mappings. Preserve original behavior/assertions, test data isolation, skipped-test reasons and failure coverage. Run source and migrated tests against an authorized sandbox when available; compilation alone is not behavioral equivalence. Do not add paid cloud runs or upload private tests without authorization.
Validation Workflow
After generating migrated code:
1. Ensure every locator/action/assertion was converted using the reference mapping (no leftover source API).
2. Ensure lifecycle (setup/teardown) matches target framework.
3. If target is Playwright: use auto-wait assertions (expect(locator).toBeVisible()), not raw waitForTimeout.
4. If target is Cypress: no async/await with cy commands; use chain style.
5. If target is Selenium: use explicit WebDriverWait, never Thread.sleep.
Reference Files Summary
| File | When to read |
|------|--------------|
| [reference/overview.md](https://github.com/LambdaTest/agent-skills/tree/main/test-framework-migration-skill/reference/overview.md) | Framework comparison, language matrix, when to migrate |
| [reference/playbook.md](https://github.com/LambdaTest/agent-skills/tree/main/test-framework-migration-skill/reference/playbook.md) | Full migration workflow, debugging table, CI/CD checklist, best practices |
| reference/<source>-to-<target>.md | Before converting any script for that pair |
Example
User request:
> Use @test-framework-migration-skill for this task: Migrates and converts test automation scripts between Selenium, Playwright, Puppeteer, and Cypress.
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
- test-guard – Rà soát mã test được tạo ra hoặc đã thay đổi theo các quy tắc kiểm thử chung trước khi…
- testdriver-e2e-testing – Xây dựng test E2E với TestDriver.ai, trình rà soát code AI chạy mọi pull request trong…
- testing-patterns – Mẫu kiểm thử Jest, factory function, chiến lược mock và quy trình TDD. Dùng khi viết…
- testing-qa – Quy trình kiểm thử và QA toàn diện, bao gồm unit test, integration test, E2E test, tự…
- testng-skill – Tạo test TestNG bằng Java với group, data provider, thực thi song song, cấu hình suite…
- textme – Nhắn tin cho Claude từ điện thoại — thiết lập daemon njerschow/textme để iMessage đến…
- the-honoured-one – Buộc AI tải đầy đủ ngữ cảnh và đọc các file liên quan trước khi thực hiện tác vụ phức…
- thick-client – Kiểm thử bảo mật được ủy quyền cho ứng dụng desktop thick client: lưu trữ cục bộ, kênh…