# playwright-best-practices-for-agents

> Claude/Codex skill by [@checkly](https://omgskills.com/library/checkly/index.md) · 0 stars · Updated 2026-10-20

Agent-first best practices for writing, structuring, debugging, and stabilizing Playwright tests in TypeScript/JavaScript, built around Playwright's agent CLI (\`playwright-cli\`) and no-GUI agentic debugging flows. Use when authoring or reviewing Playwright tests: choosing locators, writing web-first assertions, fixing flaky tests, handling authentication (SSO/2FA), mocking network/API requests, structuring projects and fixtures, generating test data, building forms and validation, pressing keys and keyboard shortcuts, hovering and other mouse actions, handling native alert/confirm/prompt dialogs, uploading or downloading files, testing iframes, multiple tabs/popups or multi-user flows, mobile and device emulation, mocking time and dates, visual regression and screenshots, tagging and annotating tests, catching console errors, testing error/offline/loading states, configuring global setup, or running Playwright in CI.

## Install

```sh
git clone https://github.com/checkly/checkly-plugin /tmp/checkly-plugin && ln -s /tmp/checkly-plugin/skills/playwright-best-practices-for-agents ~/.claude/skills/playwright-best-practices-for-agents
```

## From README

Playwright best practices Condensed, opinionated guidance for writing Playwright tests that are readable, isolated, and resilient — built for coding agents, around Playwright's agent CLI (playwright-cli) and its no-GUI debugging flows. Maintained by Checkly — the same practices apply whether you run these tests in CI or as production monitors. Load a reference file from references/ only when the task needs it (see routing table). Each reference ends with links to the full /learn articles for depth. Scope: all guidance assumes the @playwright/test test runner with TypeScript — its test, fixtures, projects, config, and web-first expect. Examples are TypeScript (.spec.ts); the same APIs work in JavaScript. It does not target the standalone playwright automation library (which has no test runner, fixtures, or auto-retrying assertions). Imports are import { test, expect } from '@playwright/test'. The agent CLI is what makes this skill shine.

## Links

- HTML page: https://omgskills.com/library/checkly/checkly-plugin/skills/playwright-best-practices-for-agents/
- GitHub: https://github.com/checkly/checkly-plugin
- Author: [@checkly](https://omgskills.com/library/checkly/index.md)

## More from this repo

- [checkly](https://omgskills.com/library/checkly/checkly-plugin/skills/checkly/index.md) — Set up, create, test and manage monitoring checks using the Checkly CLI.
   - [@checkly](https://omgskills.com/library/checkly/index.md) · 0 stars
