agentsclimarketplace

Playwright cursor rules

Skill VRIL-LABS/skill-jam/skills/ai-ml/skills-main-2/skills-main/playwright-cursor-rules

Welcome to the skill-jam ☄️🏀

Install
npx -y skills add VRIL-LABS/skill-jam --skill playwright-cursor-rules

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Expert guidance for Playwright end-to-end testing with TypeScript and JavaScript best practices

SKILL.md

2.3 KB, as published. Nobody here has run it

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();
  });
});

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.