Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

migrating-tests-to-playwright

БесплатноБез исполняемых скриптовНе проверен

Migrates Cypress, Selenium, WebdriverIO, or Protractor suites to Playwright in staged slices, each with a parity gate before the old test is deleted. Use when…

jaktestowacот jaktestowac★ 124 звезды на GitHub

Об этом скилле

Migrating Tests to Playwright

Use this skill when an existing browser suite is moving to Playwright and the migration needs to finish.

The characteristic failure is not a hard translation problem. It is a migration that stalls at 60 percent, leaving two suites, two CI jobs, two sets of conventions, and nobody willing to delete the old one because nobody can prove the new one covers the same ground. Everything below is arranged to prevent that: slices with parity gates, and a deletion at the end of every slice.

The second thing this skill insists on: a migration is the cheapest opportunity you will ever get to not port the tests that should not exist. A line-by-line translation preserves the old suite's flakiness, its weak assertions, and its coverage gaps, and adds a migration's worth of risk on top.

When to Use

  • a Cypress, Selenium, WebdriverIO, or Protractor suite is moving to Playwright
  • a migration is underway and has stalled with both suites running
  • someone is about to start translating files and there is no plan
  • the question is which tests to port and which to drop
  • a framework is being evaluated and the migration cost needs estimating

Operating Principles

  • Slices, not a big bang. Migrate a vertical slice, prove parity, delete the old tests in that slice, then move on. Two suites is a temporary state with a deadline, not a phase.
  • Every slice ends with a deletion. Without it, the old suite survives forever and the migration is never done.
  • Port behaviour, not code. The old test's intent is the requirement. Its implementation is not.
  • Triage before translating. Tests that are flaky, redundant, or prove nothing get dropped or rewritten, not carried over.
  • Parity is measured, not asserted. A slice is done when the new tests fail on the defects the old ones caught.
  • Adopt Playwright's model rather than emulating the old one. A Cypress-shaped Playwright suite gets the migration cost and none of the benefit.

Workflow

Phase 0: Inventory and triage

Do not open a test file to translate until this is finished.

Classify every test in the source suite:

Class Signal Action
Port Covers real risk, passes reliably, assertions are meaningful Migrate
Rewrite Covers real risk, but is flaky, over-mocked, or asserts nothing Migrate the intent, write the test fresh
Merge Duplicates another test's coverage Fold into one
Drop Tests a removed feature, or proves nothing, or is permanently skipped Delete, with a note
Defer Real coverage, low risk, expensive to port Backlog, and say so out loud

Record the counts. "We are porting 140 tests" and "we are porting 90, rewriting 20, dropping 30" are different projects with different estimates.

Run unslop-tests over the source suite to make the drop and rewrite decisions on evidence rather than impression. A suite where 30 percent of tests pass with the feature deleted is a suite where the migration should be a rewrite.

Phase 1: Establish the target shape

Decide the Playwright conventions before the first file, or the first ten files set them accidentally.

  • fixtures versus page objects, and what goes in each
  • auth strategy: storageState set up once, not a login in every test
  • data strategy: API seeding through fixtures, with teardown
  • what stays real and what gets stubbed
  • tags and projects
  • folder layout

Decide this deliberately rather than letting the first ten files settle it. The designing-test-automation-architecture skill (planned) will own this decision; until it exists, make the calls above explicitly and record them.

Write it as a decision record; see documenting-test-suites. In eight months someone will ask why the migration did not just keep the old page objects.

Phase 2: Slice the work

A slice is a vertical journey, not a directory. "Checkout" is a slice; "all the tests in specs/forms/" is not.

Order slices by:

  1. A thin one first, to prove the toolchain, CI, reporting, and auth end to end. Two or three tests.
  2. Highest risk next, so the most valuable coverage moves to the maintained framework earliest.
  3. Most flaky after that, because those tests are costing time now and the rewrite pays back immediately.
  4. Everything else, by cohesion.

For each slice record: the source tests, the target tests, the parity evidence, and the deletion commit.

Phase 3: Translate

Per-construct mappings are in ./resources/cypress-to-playwright-map.md and ./resources/selenium-to-playwright-map.md, including the constructs that have no direct equivalent and need a different approach.

Rules while translating:

  • Take the assertion, question the mechanics. Selectors, waits, and helper chains are the old framework's shape.
  • Do not port waits. Explicit sleeps and manual wait helpers become web-first assertions. This is the single largest quality gain available in the
Полный SKILL.md на GitHub

Установить migrating-tests-to-playwright в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

resources/cypress-to-playwright-map.mdresources/migration-plan-template.mdresources/parity-gate-checklist.mdresources/selenium-to-playwright-map.md

FAQ

Что делает скилл migrating-tests-to-playwright?

Migrates Cypress, Selenium, WebdriverIO, or Protractor suites to Playwright in staged slices, each with a parity gate before the old test is deleted. Use when porting a legacy browser suite, when deciding which tests are not worth porting, when a half-finished migration has stalled with two suites running in parallel, or when a suite migration needs a plan before anyone starts translating files.

Как установить скилл migrating-tests-to-playwright?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл migrating-tests-to-playwright запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

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

Сравнить migrating-tests-to-playwright с