fix
यह क्या करती है
यह स्किल एजेंट से टूटे हुए या अस्थिर ब्राउज़र टेस्ट की जाँच और सुधार करवाती है। यह उन डेवलपर्स के लिए है जिनके टेस्ट CI में फ़ेल होते हैं या कभी-कभी ही पास होते हैं।
कब इस्तेमाल करें
- ✓जब कोई Playwright टेस्ट फ़ेल हो और आपको कारण न पता हो।
- ✓जब कोई टेस्ट कभी पास हो और कभी फ़ेल हो।
- ✓जब कोई टेस्ट CI में फ़ेल हो पर आपके अपने कंप्यूटर पर पास हो।
Skill का लिंक
https://github.com/alirezarezvani/claude-skills/blob/main/engineering-team/playwright-pro/skills/fix/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरा लॉगिन टेस्ट CI में फ़ेल होता है पर मेरे लैपटॉप पर पास होता है। कारण पता कीजिए और उसे ठीक कीजिए।”
हर हफ़्ते 5 नई skills, 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
awaitto 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
dockerlocally 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: 2if 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.
लोकप्रियता
- GitHub स्टार
- 29k
- रैंकिंग में स्थान
- #9474
- लाइसेंस
- MIT
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
agent-launcher-orchestrator
29kआपके एजेंट को एक साफ़ लक्ष्य से शुरू करके, अपने खाते में Claude मैनेज्ड एजेंट की योजना बनाने, बनाने, जांचने और शेड्यूल करने में चरण-दर-चरण मदद करती है।
grade-iterate
29kआपके एजेंट को किसी मैनेज्ड AI एजेंट के काम को रूब्रिक से आंकने और तय संख्या के दौरों में सुधारने देती है, ताकि वह कभी अनंत चक्र में न फंसे।
interview
29kआपके एजेंट को AI एजेंट के विचार पर आपसे इंटरव्यू लेने और कुछ भी लॉन्च होने से पहले आपके जवाबों को सरल निर्माण योजना में बदलने देती है।
run-without-you
29kआपके एजेंट को मैनेज्ड AI एजेंट शेड्यूल पर या किसी घटना पर चलाने में मदद करती है, लॉन्च से पहले cron समय की जांच के साथ।
मिलती-जुलती skills
test-driven-development
311kयह आपके एजेंट को किसी भी फ़ीचर या सुधार से पहले पहले असफल होने वाला टेस्ट लिखना, उसे असफल होते देखना, फिर पास करने वाला सबसे छोटा कोड लिखना सिखाती है।
verification-before-completion
311kयह आपके एजेंट को किसी काम, सुधार या build के पूरा या पास होने का दावा करने से पहले असली जांच चलाकर उसका आउटपुट पढ़ना सिखाती है।
migrate-to-shoehorn
310kआपकी टेस्ट फ़ाइलों में जोखिम भरे type casts की जगह shoehorn लाइब्रेरी लगाती है, ताकि टेस्ट अधूरे डेटा से भी type checks पास कर सकें।