test-migration
БесплатноБез исполняемых скриптовНе проверенMigrate a test suite from one framework to another, incrementally and without losing coverage. Covers Selenium→Playwright, Cypress→Playwright, Jest→Vitest…
от petrkindlmann★ 317 звёзд на GitHubОб этом скилле
Quick Route
| You're going from → to | Jump to | First-pass tooling |
|---|---|---|
| Selenium → Playwright | Translation Patterns + references/framework-guides.md |
hand-write; no codemod worth trusting |
| Cypress → Playwright | Translation Patterns + references/framework-guides.md |
cy2pw web converter / community CLI (see tooling table); hand-write from the golden reference when no new dependency or interactive tool is allowed, and for fewer than about twenty tests, where it is faster anyway |
| Protractor → Playwright | references/framework-guides.md (urgent — EOL 2023) |
hand-write; map by.model/by.binding |
| Jest → Vitest | references/framework-guides.md |
jest.→vi. sed pass, then verify |
| Mocha → Vitest | references/framework-guides.md |
chai-matcher codemod, then verify |
| Any path, 100+ tests | Migration Workflow + Parallel Running Strategy | always parallel-run in CI |
Discovery Questions
Check .agents/qa-project-context.md first. If it exists and is filled in, use it as context and skip questions already answered there; an unfilled template answers nothing, so treat it as absent.
Current state:
- What framework are you migrating from and to? (drives the translation tables and which guide section applies)
- How many tests exist, and what is the current flakiness/skip rate? (migrating a flaky test reproduces the flakiness; skipped tests may not be worth migrating)
- Is there a coverage number today? (baseline for the parity track)
Test infrastructure:
- What supporting infrastructure exists? (page objects, custom commands, fixtures, data factories — these migrate before tests)
- How is auth/session handled? (login flows are the most common silent-breakage point — see Failure Modes)
- What CI pipeline runs the tests, and can both frameworks run simultaneously? (parallel-run is non-negotiable)
Constraints:
- Timeline pressure? (urgent = framework EOL like Protractor; comfortable = modernization)
- Budget to run both suites during migration? (double CI cost, temporarily)
- Team's familiarity with the target framework? (training gap drives the workshop/pairing plan)
Core Principles
1. Incremental over big bang
A big-bang rewrite — all tests at once — is the highest-risk approach. It freezes test development for weeks, lands a large batch of unproven tests in one drop, and removes the proven safety net before the replacement exists. Always migrate one test, one module at a time.
2. Parallel run until parity
Run both suites in CI until the new one provides at least the coverage of the old one. The old suite is your safety net; keep it non-blocking but present. Do not decommission until the new suite has caught real regressions over multiple sprints.
3. Migrate highest-value tests first
Start with critical user journeys, frequently-failing tests (which benefit most from a better framework), and high-risk areas. Save low-value tests for last — some are not worth migrating at all, and that's a valid, documented decision.
4. Modernize patterns during migration, don't just translate
Translating a bad Selenium test into a bad Playwright test wastes the opportunity. For each test ask "how would I write this from scratch in the target framework?" — user-facing locators, auto-waiting, fixtures. This applies tenfold to AI-codemod output (see Anti-Patterns).
Migration Workflow
Six phases for a typical multi-sprint migration. Use the checklists inline; heavy code lives in references.
Phase 1 — Audit existing suite (Week 1). Count tests by category, skipped/flaky percentage, coverage if measured, runtime, page-object/utility files, custom plugins, CI stages. Then categorize each test: Critical (revenue flows) → High (core journeys) → Medium (secondary) → Low (admin/edge) → Skip (disabled, duplicate, obsolete). This priority order drives everything downstream.
Phase 2 — Set up target framework (Week 1-2). Install alongside the old one. Create the config (playwright.config.ts / vitest.config.ts), a separate test directory, a non-blocking CI stage, one smoke test to prove the setup, reporters matching the existing format, shared env/secrets.
Phase 3 — Migrate shared infrastructure (Week 2-3). Infrastructure before tests, in this order: base page object/test base → auth helpers → API client helpers → common page objects (nav/header/footer) → data factories → custom assertions → feature-specific page objects (with their tests). **Capture `
Установить test-migration в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл test-migration?
Migrate a test suite from one framework to another, incrementally and without losing coverage. Covers Selenium→Playwright, Cypress→Playwright, Jest→Vitest, Mocha→Vitest, and Protractor→Playwright, with parallel CI running, locator/assertion translation, and a coverage-parity track. Use when: "migrate tests," "switch framework," "Selenium to Playwright," "Jest to Vitest," "framework migration." Not for: bulk selector regeneration after a UI refactor on the SAME framework — use selector-drift-recovery. Not for: healing one flaky test at runtime — use test-reliability. Not for: modernizing patterns without changing framework — use ai-qa-review. Related: playwright-automation, cypress-automation, unit-testing, ci-cd-integration, test-reliability.
Как установить скилл test-migration?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл test-migration запускает скрипты?
Нет, скилл состоит только из инструкций (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