跳到主要内容
知仓学习社ZHICANG

test-framework-migration-skill

Migrates and converts test automation scripts between Selenium, Playwright, Puppeteer, and Cypress.

不碰外部(只输出文字)无严重或高危命中sickn33/agentic-awesome-skills

它会碰到什么

扫了多少1 个文本文件,9 KB
它会碰到什么不碰外部(只输出文字)
命中总数0 处
命中统计严重 0 · 高 0 · 中 0 · 低 0

这一栏是扫描器报的事实,不是结论。命中多不等于有毒(安全工具、规则库、示例脚本本来就会包含危险写法),命中少也不等于干净。它和你手上的凭据、文件、网络有什么关系,需要你自己看。

技能内容

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 is typically JS/TS; migration usually implies rewriting to TypeScript or JavaScript. Mention this if source is Java/C#/Python. |

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

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 |

| Playwright → Selenium | reference/playwright-to-selenium.md |

| Selenium → Puppeteer | reference/selenium-to-puppeteer.md |

| Puppeteer → Selenium | reference/puppeteer-to-selenium.md |

| Puppeteer → Playwright | reference/puppeteer-to-playwright.md |

| Playwright → Puppeteer | reference/playwright-to-puppeteer.md |

| Cypress → Playwright | reference/cypress-to-playwright.md |

| Playwright → Cypress | reference/playwright-to-cypress.md |

| Selenium → Cypress | reference/selenium-to-cypress.md |

| Cypress → Selenium | 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 |

| Full Selenium patterns, POM, cloud | selenium-skill and selenium-skill/reference/cloud-integration.md |

| Full Puppeteer patterns, cloud | puppeteer-skill and puppeteer-skill/reference/cloud-integration.md |

| Full Cypress patterns, cloud | cypress-skill and cypress-skill/reference/cloud-integration.md |

| TestMu capabilities (all frameworks) | shared/testmu-cloud-reference.md |

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 | Framework comparison, language matrix, when to migrate |

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

想直接用这个技能?

本站把开放许可(MIT / Apache 等)的技能按仓库打包整理到网盘,点一下转存到你自己的网盘,不用一个个从 GitHub 拉。许可未声明的技能只给原始仓库链接,不打包。

它属于哪个仓库

星标★ 46,490
本站分层T1
该仓技能数6676
原文件路径plugins/agentic-awesome-skills-claude/skills/test-framework-migration-skill/SKILL.md

同一个仓库里的其他技能

看这个仓库的全部 6676 个技能

同名技能的其他版本

有 3 个不同仓库或目录里都有叫 test-framework-migration-skill 的技能。它们内容并不相同,别混用: