Playwright

From ariadoss/superskills · View interactive version

Playwright is an AI agent skill from the GitHub repository ariadoss/superskills. End-to-end testing with Playwright — generate, run, and debug E2E tests.

How to use this skill

Skill file

Playwright E2E Testing

Generate and run Playwright end-to-end tests for web applications.

Prerequisites

npx playwright --version

If not installed:

npm init playwright@latest
# or add to existing project:
npm install -D @playwright/test && npx playwright install

Workflow

1. Analyze

Read the source files for the page/component to test. Understand routes, interactive elements, and expected behaviors.

2. Generate Test File

Create a test file following the project's existing patterns and directory structure.

import { test, expect } from '@playwright/test';

test.describe('Feature Name', () => {
  test.beforeEach(async ({ page }) => {
    // Setup: navigate, authenticate, seed data
  });

  test('should do expected behavior', async ({ page }) => {
    // Arrange
    // Act
    // Assert
  });
});

3. Run Tests

npx playwright test <file>           # Run specific test file
npx playwright test --headed          # With visible browser
npx playwright test --ui              # Playwright UI mode
npx playwright test --trace on        # Capture trace for debugging

4. Debug Failures

Capabilities

Tips

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.