Agent skill · software engineering · alirezarezvani

migrate

Use when moving tests from Cypress or Selenium to Playwright ('migrate tests', 'convert tests', 'replace selenium').

Why this skill is useful

Adds an executable migration script that automates the conversion of test files from Cypress or Selenium to Playwright, including specific mapping and best practices.

What it needs

Requires playwright installed locally. About 2k tokens when loaded. Last updated 2026-08-05. 23,939 stars on the source repository.

What this skill does

Migrate to Playwright Interactive migration from Cypress or Selenium to Playwright with file-by-file conversion. Input $ARGUMENTS can be: "from cypress" — migrate Cypress test suite "from selenium" — migrate Selenium/WebDriver tests A file path: convert a specific test file Empty: auto-detect source framework Steps 1. Detect Source Framework Use Explore subagent to scan: cypress/ directory or cypress.config.ts → Cypress selenium, webdriver in package.json deps → Selenium .py test files with selenium imports → Selenium (Python) 2. Assess Migration Scope Count files and categorize: Size Files Approach --- --- --- Small (1-10) Convert sequentially Direct conversion Medium (11-30) Batch in groups of 5 Use sub-agents Large (31+) Use /batch Parallel conversion with /batch 3. Set Up Playwright (If Not Present) Run /pw:pw-init first if Playwright isn't configured. 4. Convert Files For each file, apply the appropriate mapping: Cypress → Playwright Load cypress-mapping.md for complete reference. Key translations: Cypress custom commands → Playwright fixtures or helper functions Cypress plugins → Playwright config or fixtures before/beforeEach → test.beforeAll() / test.beforeEach() Selenium → Playwright Load selenium-mapping.md for complete reference. Key translations: 5. Upgrade Locators During conversion, upgrade selectors to Playwright best practices: #id → getByTestId() or getByRole() .class → getByRole() or getByText() [data-testid] → getByTestId() XPath → role-based locators 6. Convert Custom Commands / Utilities Cypress custom commands → Playwright custom fixtures via test.extend() Selenium page objects → Playwright page objects (keep structure, update API) Shared helpers → TypeScript utility functions 7. Verify Each Converted File After converting each file: Fix any compilation or runtime errors before moving to the next file. 8. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills alirezarezvani/migrate--32be39

View the source on GitHub

Browse the @skills marketplace