본문으로 건너뛰기
Skillpedia
테스트29k · #9476

migrate

하는 일

이 스킬은 에이전트가 기존 Cypress나 Selenium 테스트 모음을 Playwright로 바꾸게 합니다. 모든 것을 손으로 다시 쓰지 않고 테스트 도구를 바꾸려는 팀을 위한 스킬입니다.

사용하는 경우

  • ✓팀이 Cypress를 떠나 Playwright를 쓰고 싶을 때.
  • ✓오래된 Selenium 테스트를 Playwright에서 실행해야 할 때.
  • ✓테스트 파일이 많아서 묶음 단위로 변환하고 싶을 때.

스킬 링크

https://github.com/alirezarezvani/claude-skills/blob/main/engineering-team/playwright-pro/skills/migrate/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/alirezarezvani/claude-skills/blob/main/engineering-team/playwright-pro/skills/migrate/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“Cypress 테스트를 Playwright로 바꿔 주세요. 로그인 테스트부터 시작해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 먼저 테스트가 어떤 도구를 쓰는지 알아내고 파일 수를 셉니다. 그다음 오래된 명령을 새 명령으로 옮기는 대응표를 써서 묶음 단위로 변환합니다. 예를 들어 cy.visit는 page.goto가 됩니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

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:

Migration Assessment:
- Total test files: X
- Cypress custom commands: Y
- Cypress fixtures: Z
- Estimated effort: [small|medium|large]
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:

cy.visit(url)           → page.goto(url)
cy.get(selector)        → page.locator(selector) or page.getByRole(...)
cy.contains(text)       → page.getByText(text)
cy.find(selector)       → locator.locator(selector)
cy.click()              → locator.click()
cy.type(text)           → locator.fill(text)
cy.should('be.visible') → expect(locator).toBeVisible()
cy.should('have.text')  → expect(locator).toHaveText(text)
cy.intercept()          → page.route()
cy.wait('@alias')       → page.waitForResponse()
cy.fixture()            → JSON import or test data file

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:

driver.get(url)                    → page.goto(url)
driver.findElement(By.id('x'))     → page.locator('#x') or page.getByTestId('x')
driver.findElement(By.css('.x'))   → page.locator('.x') or page.getByRole(...)
element.click()                    → locator.click()
element.sendKeys(text)             → locator.fill(text)
element.getText()                  → locator.textContent()
WebDriverWait + ExpectedConditions → expect(locator).toBeVisible()
driver.switchTo().frame()          → page.frameLocator()
Actions                            → locator.hover(), locator.dragTo()

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:

npx playwright test <converted-file> --reporter=list

Fix any compilation or runtime errors before moving to the next file.

8. Clean Up

After all files are converted:

  • Remove Cypress/Selenium dependencies from package.json
  • Remove old config files (cypress.config.ts, etc.)
  • Update CI workflow to use Playwright
  • Update README with new test commands

Ask user before deleting anything.

Output

  • Conversion summary: files converted, total tests migrated
  • Any tests that couldn't be auto-converted (manual intervention needed)
  • Updated CI config
  • Before/after comparison of test run results
자주 묻는 질문

얼마나 큰 테스트 모음까지 다룰 수 있나요?

작은 모음은 하나씩, 중간 규모는 묶음으로, 큰 모음은 병렬 배치로 변환하도록 이 스킬이 제안합니다.

Playwright 설정도 해 주나요?

아직 Playwright가 설정되어 있지 않다면, 에이전트에게 먼저 pw-init 설정을 실행하라고 안내합니다.

어떤 오래된 도구를 지원하나요?

Cypress와 Selenium입니다. Selenium을 쓰는 Python 테스트도 포함합니다.

상세 정보

작성자의 원본 설명

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

repo: alirezarezvani/claude-skills

인기도

GitHub 스타
29k
순위
#9476
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬