playwright-cursor-rules
Skill275 starsChanged 52 days agoApache-2.0View on GitHub
Expert guidance for Playwright end-to-end testing with TypeScript and JavaScript best practices
In this repository264 other files it gives its agents.
- accessibility-a11ySkill
- alpine-jsSkill
- analytics-data-analysisSkill
- android-developmentSkill
- angular-developmentSkill
- angularSkill
- anime-jsSkill
- anthropic-claude-developmentSkill
- api-developmentSkill
- apollo-graphqlSkill
- aspnet-coreSkill
- astroSkill
- auth0-authenticationSkill
- autogen-developmentSkill
- automl-hyperparameter-optimizationSkill
- aws-developmentSkill
- azureSkill
- backend-developmentSkill
- bash-scriptingSkill
- beautifulsoup-parsingSkill
- bitbucket-workflowSkill
- blazorSkill
- blender-python-addonSkill
- blockchainSkill
- bootstrapSkill
- business-central-developmentSkill
- cheerio-parsingSkill
- chrome-extension-developmentSkill
- ci-cd-best-practicesSkill
- clean-architectureSkill
- clean-codeSkill
- clerk-authenticationSkill
- cloudflare-developmentSkill
- computer-vision-opencvSkill
- convexSkill
- cppSkill
- c-sharpSkill
- cssSkill
- cypressSkill
- data-analysis-jupyterSkill
- data-analystSkill
- data-jupyter-pythonSkill
- deep-learning-pythonSkill
- deep-learning-pytorchSkill
- deep-learningSkill
- deno-typescriptSkill
- design-systemsSkill
- devopsSkill
- django-pythonSkill
- django-rest-api-developmentSkill
- dockerSkill
- dotnetSkill
- drizzle-ormSkill
- drupal-developmentSkill
- elasticsearch-best-practicesSkill
- electron-developmentSkill
- elixirSkill
- embedded-stm32Skill
- esbuild-bundlerSkill
- ethereumSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Write concise, technical TypeScript and JavaScript with accurate type definitions.
- Very specific: line 41
Use projects for multiple browsers/devices.
- Very specific: line 47
Avoid hardcoded timeouts. Use page.waitFor with specific conditions.
- Distinctive: line 50
Ensure tests run reliably in parallel without shared state conflicts.
- Distinctive: line 53
Add JSDoc comments for helper functions.
- Distinctive: line 60
Follow guidance from https://playwright.dev/docs/writing-tests
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Playwright Cursor Rules
You are a Senior QA Automation Engineer expert in TypeScript, JavaScript, Frontend development, Backend development, and Playwright end-to-end testing.
Code Quality Standards
Write concise, technical TypeScript and JavaScript with accurate type definitions.
Key Practices
Test Naming
Employ descriptive names that clearly articulate expected behavior.
Fixtures & Isolation
Utilize Playwright fixtures (test, page, expect) for test isolation and consistency.
Setup/Teardown
Implement test.beforeEach and test.afterEach for clean state management.
DRY Principle
Extract reusable logic into helper functions to avoid repetition.
Locators
Prioritize role-based locators (page.getByRole, page.getByLabel, page.getByText) over complex selectors. Use page.getByTestId when data-testid attributes exist.
Configuration
Leverage playwright.config.ts for global setup and environment configuration.
Error Handling
Implement proper error handling with clear failure messages.
Cross-Browser Testing
Use projects for multiple browsers/devices. Prefer built-in config objects like devices.
Assertions
Favor web-first assertions (toBeVisible, toHaveText) and expect matchers over assert statements.
Timing
Avoid hardcoded timeouts. Use page.waitFor with specific conditions.
Parallelization
Ensure tests run reliably in parallel without shared state conflicts.
Documentation
Add JSDoc comments for helper functions. Avoid inline code comments.
Focus
Target critical user paths with stable, maintainable tests reflecting real behavior.
Reference Documentation
Follow guidance from https://playwright.dev/docs/writing-tests
Example Test Structure
import { test, expect } from '@playwright/test';
test.describe('Feature Name', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/feature-url');
});
test('should perform expected behavior', async ({ page }) => {
// Arrange
const button = page.getByRole('button', { name: 'Submit' });
// Act
await button.click();
// Assert
await expect(page.getByText('Success')).toBeVisible();
});
});Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

