Syntic

Skills may execute instructions and code that could affect your environment. Marketplace scans reduce risk but do not guarantee safety. Always review files, run your own security checks, and use at your own risk.

EngineeringFree Safe

fix

Security Scan Summary

Status: Safe

Source: Syntic Skills registry

Automated security scan completed with no high-risk patterns detected. Manual review is still required.

About This Skill

Use when a Playwright test fails or passes intermittently. Diagnose using taxonomy and apply targeted fixes.

Downloadable SKILL.md

Download SKILL.md and place it in your Syntic skills folder. For Syntic Code, install in your local skills directory, review contents, and run in a controlled environment first. Acknowledge the risk notice above to enable the download.

SKILL.md
---
name: fix
description: Use when a Playwright test fails or passes intermittently. Diagnose using taxonomy and apply targeted fixes.
category: Engineering
version: 1.0.0
tools: []
---

# Fix Failing or Flaky Tests

Diagnose and fix Playwright tests using a systematic taxonomy.

## Reproduce the Failure

Run the test:
```bash
npx playwright test <file> --reporter=list
```

If test passes, run burn-in:
```bash
npx playwright test <file> --repeat-each=10
```

If still passes, try parallel:
```bash
npx playwright test --fully-parallel --workers=4 --repeat-each=5
```

Capture trace:
```bash
npx playwright test <file> --trace=on --retries=0
```

## Categorize the Failure

| Category | Symptom | Diagnosis |
|---|---|---|
| Timing/Async | Intermittent everywhere | `--repeat-each=20` reproduces locally |
| Test Isolation | Fails in suite, passes alone | `--workers=1` passes |
| Environment | Fails in CI, passes locally | Compare screenshots/traces |
| Infrastructure | Random, no pattern | Browser internals error |

## Apply Targeted Fixes

**Timing/Async:**
- Replace `waitForTimeout()` with web-first assertions
- Add `await` to all Playwright calls
- Wait for network responses before asserting
- Use `toBeVisible()` before interactions

**Test Isolation:**
- Remove shared mutable state
- Create test data per-test via API/fixtures
- Use unique identifiers (timestamps, random strings)
- Check for database leaks

**Environment:**
- Match viewport sizes (local vs CI)
- Account for font rendering differences
- Use Docker locally to match CI
- Check timezone-dependent assertions

**Infrastructure:**
- Increase timeout for slow runners
- Add `retries: 2` in CI config
- Check browser OOM (reduce workers)
- Verify browser dependencies installed

## Verify the Fix

Run 10x to confirm stability:
```bash
npx playwright test <file> --repeat-each=10
```

All 10 must pass.

## Prevent Recurrence

- Add to CI with `retries: 2`
- Enable `trace: 'on-first-retry'` in config
- Document fix pattern in test conventions

Bundle Download

Includes SKILL.md and bundled support files where provided. Risk acknowledgement is required.

Install Targets

Syntic App

  1. 1. Create a dedicated folder for this skill in your local skills library.
  2. 2. Place SKILL.md into that folder.
  3. 3. Restart Syntic and invoke this skill on matching tasks.

Syntic Code (CLI)

  1. 1. Save SKILL.md in your local Syntic Code skills directory.
  2. 2. Keep related files in the same skill folder.
  3. 3. Run in a safe environment and validate outputs.

Source

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

Open Source Link
Engineering

Related Skills