Test Framework Migration Skill

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

Published by @LambdaTest·0 agent reads / 30d·0 saves·

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 codeSource 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 → TargetLanguage note
Selenium (Java/Python/C#) → PlaywrightPlaywright is typically JS/TS; migration usually implies rewriting to TypeScript or JavaScript. Mention this if source is Java/C#/Python.
Selenium (JS) → PlaywrightSame language (JS/TS) possible.
Playwright/Puppeteer/Cypress → SeleniumTarget can be Java, Python, JS, C#. Prefer same as project or ask.
Playwright ↔ Puppeteer ↔ CypressTypically 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 → TargetReference file
Selenium → Playwrightreference/selenium-to-playwright.md
Playwright → Seleniumreference/playwright-to-selenium.md
Selenium → Puppeteerreference/selenium-to-puppeteer.md
Puppeteer → Seleniumreference/puppeteer-to-selenium.md
Puppeteer → Playwrightreference/puppeteer-to-playwright.md
Playwright → Puppeteerreference/playwright-to-puppeteer.md
Cypress → Playwrightreference/cypress-to-playwright.md
Playwright → Cypressreference/playwright-to-cypress.md
Selenium → Cypressreference/selenium-to-cypress.md
Cypress → Seleniumreference/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

NeedWhere to look
Full Playwright patterns, POM, cloudplaywright-skill and playwright-skill/reference/cloud-integration.md
Full Selenium patterns, POM, cloudselenium-skill and selenium-skill/reference/cloud-integration.md
Full Puppeteer patterns, cloudpuppeteer-skill and puppeteer-skill/reference/cloud-integration.md
Full Cypress patterns, cloudcypress-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

FileWhen to read
reference/overview.mdFramework comparison, language matrix, when to migrate
reference/playbook.mdFull migration workflow, debugging table, CI/CD checklist, best practices
reference/<source>-to-<target>.mdBefore converting any script for that pair

Bundled with this artifact

17 files

Reference files that ship alongside this artifact. Agents pull these in only when the task needs them.

More on the bench

SKILL0

Vercel Deployment

Best practices for Vercel deployments including serverless functions, Edge Runtime, middleware, caching, environment variables, and CI/CD configuration

software-engineering+1
0
SKILL0

Tensorflow And Deep Learning Rules

TensorFlow and deep learning rules for building, training, evaluating, and deploying neural network models

data-science-ml+1
0
SKILL0

Tanstack Start

TanStack Start full-stack React framework using server functions, API routes, SSR, streaming with defer(), and multi-platform deployment via Vinxi/Nitro

software-engineering+1
0