# Chromestatus Playwright Testing

> Chromestatus Playwright Testing is an Agent Skill for testing & quality published in the GoogleChrome/chromium-dashboard repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Guidance for running, debugging, and updating Playwright end-to-end tests in chromium-dashboard.

- Skill name: `chromestatus-playwright-testing`
- Category: [Testing & Quality](https://www.openparable.com/skill/testing-quality/1)
- Source: https://github.com/GoogleChrome/chromium-dashboard/blob/HEAD/.agents/skills/chromestatus-playwright-testing/SKILL.md
- Repository: GoogleChrome/chromium-dashboard (734 GitHub stars when collected)

## SKILL.md

# Playwright Testing Skill

This skill provides guidance on how to manage end-to-end tests using Playwright. Use these commands when frontend changes cause visual or functional regressions in the integration tests.

## Running Tests

### Run all Playwright tests
```bash
make pwtests
```

### Run tests in UI mode (Interactive)
Useful for debugging and seeing the browser in action.
```bash
make pwtests-ui
```

## Correcting Tests and Updating Snapshots

If your changes are intentional but cause visual regressions (e.g., you updated a CSS style or modified a component's layout), you may need to update the baseline snapshots.

### Update Playwright snapshots
```bash
make pwtests-update
```

## Debugging

### Show test report
If tests fail in CI or locally, you can view a detailed HTML report.
```bash
make pwtests-report
```

### Debug a specific test
```bash
make pwtests-debug
```

## Best Practices
1. **Verify Before Submitting**: Always run `make pwtests` locally if you change any files in `client-src/elements/` or `templates/`.
2. **Review Snapshots**: When running `make pwtests-update`, carefully review the diffs in the `__screenshots__` directories to ensure only intended changes are captured.
3. **Shutdown Environment**: If the Playwright environment stays active and consumes resources, you can manually shut it down.
```bash
make pwtests-shutdown
```

## Reference
- **Test Directory**: @packages/playwright/tests
- **Configuration**: @playwright.config.ts
- **Build Targets**: @Makefile

---

Source: https://www.openparable.com/skill/testing-quality/chromestatus-playwright-testing (OpenParable). Cite the canonical URL above.
