К основному содержанию
скилл CX Codex

test-framework-migration-skill — скилл для Claude Code

Скилл test-framework-migration-skill переносит автотесты между Selenium, Playwright, Puppeteer и Cypress. Помогает сменить тестовый стек без ручной переделки локаторов и проверок.

MIT 229 установок ★ 393 обновлён 2026-10-13

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add LambdaTest/agent-skills --skill test-framework-migration-skill -a claude-code
Открыть на GitHub

Что делает test-framework-migration-skill

Скилл анализирует тестовые сценарии и переписывает их под целевой инструмент. Поддерживаются пять языков: Java, Python, C#, JavaScript и TypeScript. Модель сверяется со справочниками соответствий, заменяя селекторы, действия на страницах, проверки и методы инициализации браузера.

При конвертации учитываются различия архитектур. Для Playwright скрипты переводятся на автоожидания вместо waitForTimeout. При сборке под Cypress агент убирает async/await в цепочках вызовов, а для Selenium задействует явные WebDriverWait вместо пауз Thread.sleep. Если вы переносите тесты с Java Selenium на Playwright, код придётся переписать на JavaScript или TypeScript.

Какие задачи решает

  • сконвертировать тесты из Selenium в Playwright
  • переписать сценарии Puppeteer на Cypress
  • перевести ожидания на встроенный auto-wait в Playwright
  • очистить тесты от вызовов Thread.sleep при переносе на Selenium

Примеры запросов агенту

  • Перепиши этот набор тестов из Selenium на Java в сценарии Playwright на TypeScript.
  • Сконвертируй файл с тестами Cypress в тесты для Playwright.
  • Перенеси скрипты Puppeteer на Selenium с использованием Python.

Как установить test-framework-migration-skill

1Через Skills CLI (Vercel)

npx skills add LambdaTest/agent-skills --skill test-framework-migration-skill -a claude-code

2Вручную: положить файлы

~/.claude/skills/test-framework-migration-skill/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/test-framework-migration-skill/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о test-framework-migration-skill

Как установить test-framework-migration-skill в Claude Code?

Выполните в терминале команду npx skills add LambdaTest/agent-skills --skill test-framework-migration-skill -a claude-code. Конфигурация сохранится в файле ~/.claude/skills/test-framework-migration-skill/SKILL.md.

Какие фреймворки поддерживает этот скилл?

Навык работает с Selenium, Playwright, Puppeteer и Cypress во всех направлениях между ними.

Что происходит с ожиданиями и паузами при миграции?

Скилл заменяет жесткие таймауты на штатные механизмы целевого фреймворка. Например, при переносе в Playwright генерируются проверки expect(locator).toBeVisible(), а для Selenium создаются явные WebDriverWait.

Исходный текст

SKILL.md · MIT
---
name: test-framework-migration-skill
description: >
  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 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]".
languages:
  - Java
  - Python
  - JavaScript
  - TypeScript
  - C#
category: e2e-testing
license: MIT
metadata:
  author: TestMu AI
  version: "1.0"
---

# Test Framework Migration Skill

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](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](reference/selenium-to-playwright.md) |
| Playwright → Selenium | [reference/playwright-to-selenium.md](reference/playwright-to-selenium.md) |
| Selenium → Puppeteer | [reference/selenium-to-puppeteer.md](reference/selenium-to-puppeteer.md) |
| Puppeteer → Selenium | [reference/puppeteer-to-selenium.md](reference/puppeteer-to-selenium.md) |
| Puppeteer → Playwright | [reference/puppeteer-to-playwright.md](reference/puppeteer-to-playwright.md) |
| Playwright → Puppeteer | [reference/playwright-to-puppeteer.md](reference/playwright-to-puppeteer.md) |
| Cypress → Playwright | [reference/cypress-to-playwright.md](reference/cypress-to-playwright.md) |
| Playwright → Cypress | [reference/playwright-to-cypress.md](reference/playwright-to-cypress.md) |
| Selenium → Cypress | [reference/selenium-to-cypress.md](reference/selenium-to-cypress.md) |
| Cypress → Selenium | [reference/cypress-to-selenium.md](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](../playwright-skill/reference/cloud-integration.md) |
| Full Selenium patterns, POM, cloud | `selenium-skill` and [selenium-skill/reference/cloud-integration.md](../selenium-skill/reference/cloud-integration.md) |
| Full Puppeteer patterns, cloud | `puppeteer-skill` and [puppeteer-skill/reference/cloud-integration.md](../puppeteer-skill/reference/cloud-integration.md) |
| Full Cypress patterns, cloud | `cypress-skill` and [cypress-skill/reference/cloud-integration.md](../cypress-skill/reference/cloud-integration.md) |
| TestMu capabilities (all frameworks) | [shared/testmu-cloud-reference.md](../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](reference/overview.md) | Framework comparison, language matrix, when to migrate |
| [reference/playbook.md](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 |

© TestMu AI · MIT · LambdaTest/agent-skills

Похожие скиллы

Все скиллы по теме «Тесты и QA» →

Из того же набора47

Весь набор →
mocha-skill Генерирует тесты Mocha для JavaScript и TypeScript с проверками Chai и моками Sinon. Охватывает модульное тестирование. CX Codex +1 235установок unittest-skill Генерирует тесты на встроенном фреймворке Python unittest с TestCase, setUp/tearDown и методами проверки. Срабатывает, когда вы упоминаете unittest, TestCase или self.assertEqual. CX Codex +1 235установок espresso-skill Скилл помогает писать UI-тесты Android-приложений на Espresso для Kotlin или Java. Используйте его, чтобы проверить действия на экране и ожидаемое состояние интерфейса. CX Codex +1 234установок laravel-dusk-skill Генерирует E2E-тесты на Laravel Dusk. Агент пишет PHP-код с $browser->visit, проверками форм и Page Objects. CX Codex +1 231установок behave-skill Создаёт BDD-тесты на Python: Gherkin-сценарии и шаги Behave. Описывает и проверяет пользовательские сценарии. CX Codex +1 227установок karma-skill Собирает karma.conf.js для браузерных тестов на Jasmine, Mocha или QUnit и показывает, как запустить прогон. CX Codex +1 226установок selenide-skill Генерирует UI-тесты на Java с помощью Selenide, подбирает селекторы и настраивает проверки условий с автоожиданиями. CX Codex +1 225установок xunit-skill Задаёт агенту правила xUnit.net — атрибуты, фикстуры и проверки — для написания тестов на C#. CX Codex +1 224установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой