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

fix

하는 일

이 스킬은 에이전트가 깨졌거나 간헐적으로 실패하는 브라우저 테스트를 진단하고 고치게 합니다. CI에서 실패하거나 때때로만 통과하는 테스트를 가진 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓Playwright 테스트가 실패했는데 이유를 모를 때.
  • ✓테스트가 어떤 때는 통과하고 어떤 때는 실패할 때.
  • ✓테스트가 CI에서는 실패하지만 내 컴퓨터에서는 통과할 때.

스킬 링크

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

AI에게 요청하는 예시

“제 로그인 테스트가 CI에서는 실패하고 노트북에서는 통과합니다. 원인을 찾아 고쳐 주세요.”

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

작동 방식

에이전트는 테스트를 다시 실행해 문제를 재현하고, 무슨 일이 있었는지 추적 기록을 남깁니다. 그다음 원인을 타이밍, 테스트 격리, 환경, 인프라의 네 가지 유형 중 하나로 분류하고, 그 원인에 맞는 수정을 적용합니다.

기술 내용 (원본 SKILL.md)

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

Fix Failing or Flaky Tests

Diagnose and fix a Playwright test that fails or passes intermittently using a systematic taxonomy.

Input

$ARGUMENTS contains:

  • A test file path: e2e/login.spec.ts
  • A test name: ""should redirect after login"`
  • A description: "the checkout test fails in CI but passes locally"

Steps

1. Reproduce the Failure

Run the test to capture the error:

npx playwright test <file> --reporter=list

If the test passes, it's likely flaky. Run burn-in:

npx playwright test <file> --repeat-each=10 --reporter=list

If it still passes, try with parallel workers:

npx playwright test --fully-parallel --workers=4 --repeat-each=5

2. Capture Trace

Run with full tracing:

npx playwright test <file> --trace=on --retries=0

Read the trace output. Use /debug to analyze trace files if available.

3. Categorize the Failure

Load flaky-taxonomy.md from this skill directory.

Every failing test falls into one of four categories:

Category Symptom Diagnosis
Timing/Async Fails intermittently everywhere --repeat-each=20 reproduces locally
Test Isolation Fails in suite, passes alone --workers=1 --grep "test name" passes
Environment Fails in CI, passes locally Compare CI vs local screenshots/traces
Infrastructure Random, no pattern Error references browser internals

4. Apply Targeted Fix

Timing/Async:

  • Replace waitForTimeout() with web-first assertions
  • Add await to missing Playwright calls
  • Wait for specific network responses before asserting
  • Use toBeVisible() before interacting with elements

Test Isolation:

  • Remove shared mutable state between tests
  • Create test data per-test via API or fixtures
  • Use unique identifiers (timestamps, random strings) for test data
  • Check for database state leaks

Environment:

  • Match viewport sizes between local and CI
  • Account for font rendering differences in screenshots
  • Use docker locally to match CI environment
  • Check for timezone-dependent assertions

Infrastructure:

  • Increase timeout for slow CI runners
  • Add retries in CI config (retries: 2)
  • Check for browser OOM (reduce parallel workers)
  • Ensure browser dependencies are installed

5. Verify the Fix

Run the test 10 times to confirm stability:

npx playwright test <file> --repeat-each=10 --reporter=list

All 10 must pass. If any fail, go back to step 3.

6. Prevent Recurrence

Suggest:

  • Add to CI with retries: 2 if not already
  • Enable trace: 'on-first-retry' in config
  • Add the fix pattern to project's test conventions doc

Output

  • Root cause category and specific issue
  • The fix applied (with diff)
  • Verification result (10/10 passes)
  • Prevention recommendation
자주 묻는 질문

원인은 어떻게 알아내나요?

실패를 네 가지 유형으로 나누며, 유형마다 고유한 신호와 빠른 확인 방법이 있습니다. 예를 들어 전체 실행에서만 실패하는 테스트는 격리 문제일 수 있습니다.

테스트를 여러 번 실행하나요?

네. 여러 번, 그리고 병렬 작업자로 반복 실행해 간헐적인 실패가 드러나게 합니다.

무엇을 주어야 하나요?

테스트 파일 경로, 테스트 이름, 또는 문제에 대한 짧은 설명이면 시작하기에 충분합니다.

상세 정보

작성자의 원본 설명

Use when a Playwright test fails or is flaky ('fix test', 'flaky test', 'test passes sometimes', 'intermittent failure'). Diagnoses the cause and fixes it.

repo: alirezarezvani/claude-skills

인기도

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

이 스킬이 유용한가요?

0

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

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬