Agent Skill
2/7/2026playwright
Playwright browser automation for E2E testing and web scraping. This skill should be used when writing Playwright tests, creating browser automation scripts, handling WebSockets, managing multiple browser contexts, parallelizing test execution, optimizing test speed, debugging flaky tests, working with playwright.config.ts configuration, or setting up GitHub Actions CI workflows for Playwright tests with browser caching and sharding.
K
kettleofketchup
0GitHub Stars
1Views
npx skills add kettleofketchup/dotfiles
SKILL.md
| Name | playwright |
| Description | Playwright browser automation for E2E testing and web scraping. This skill should be used when writing Playwright tests, creating browser automation scripts, handling WebSockets, managing multiple browser contexts, parallelizing test execution, optimizing test speed, debugging flaky tests, working with playwright.config.ts configuration, or setting up GitHub Actions CI workflows for Playwright tests with browser caching and sharding. |
name: playwright description: Playwright browser automation for E2E testing and web scraping. This skill should be used when writing Playwright tests, creating browser automation scripts, handling WebSockets, managing multiple browser contexts, parallelizing test execution, optimizing test speed, debugging flaky tests, working with playwright.config.ts configuration, or setting up GitHub Actions CI workflows for Playwright tests with browser caching and sharding. version: 1.1.0 last_updated: 2026-02-01 playwright_version: "1.50+"
Playwright Browser Automation
TypeScript/JavaScript patterns for E2E testing and web scraping.
Quick Reference
E2E Test
import { test, expect } from '@playwright/test';
test('should work', async ({ page }) => {
await page.goto('/');
await page.getByRole('button', { name: 'Submit' }).click();
await expect(page.getByText('Success')).toBeVisible();
});
Scraping Script
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
await page.goto('https://example.com');
const data = await page.locator('.item').allTextContents();
await browser.close();
Selectors (prefer in order)
page.getByRole()- accessibility-based (buttons, links, headings)page.getByTestId()or[data-testid="..."]- explicit test hooks (most reliable)page.getByText()- visible text (exact match preferred)page.locator()- CSS/XPath fallback
Avoid has-text() for Buttons
Bad - fragile, breaks if text changes:
page.locator('button:has-text("Start Draft")')
Good - stable, explicit test contract:
page.locator('[data-testid="startDraftButton"]')
// or
page.getByTestId('startDraftButton')
When adding new UI elements, always add data-testid attributes for testability.
E2E Testing References
references/e2e/ci.md- GitHub Actions CI, browser caching, sharding, Docker pitfallsreferences/e2e/config.md- playwright.config.ts, projects, global setupreferences/e2e/performance.md- Speed optimization, resource blocking, wait strategiesreferences/e2e/parallel.md- Workers, sharding, test parallelizationreferences/e2e/debugging.md- Traces, flaky tests, CI artifactsreferences/e2e/websockets.md- WS testing, mocking, reconnection, multi-user
Web Scraping References
references/scraping/performance.md- Parallel contexts, concurrency, speedreferences/scraping/contexts.md- Rotation, proxies, anti-detectionreferences/scraping/network.md- Request interception, blocking, mockingreferences/scraping/websockets.md- WS data capture, live feedsreferences/scraping/extraction.md- Data extraction, pagination, infinite scroll
Skills Info
Original Name:playwrightAuthor:kettleofketchup
Download