Design and execute comprehensive Playwright test suites for web applications.
Scanned 2/12/2026
Install via CLI
openskills install hffmnnj/opencode-goopspec---
name: playwright-testing
description: Design and execute comprehensive Playwright test suites for web applications.
category: review
triggers:
- playwright
- testing
- e2e
- suites
version: 0.2.1
---
# Playwright Testing Skill
## Purpose
Design and execute comprehensive Playwright test suites for web applications.
## Test Organization
```
tests/
e2e/
auth/
login.spec.ts
signup.spec.ts
dashboard/
overview.spec.ts
fixtures/
auth.fixture.ts
pages/
login.page.ts
dashboard.page.ts
```
## Test Structure
```typescript
import { test, expect } from '@playwright/test';
test.describe('Feature: User Login', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/login');
});
test('should login with valid credentials', async ({ page }) => {
await page.fill('[data-testid="email"]', 'user@example.com');
await page.fill('[data-testid="password"]', 'password');
await page.click('[data-testid="submit"]');
await expect(page).toHaveURL('/dashboard');
});
test('should show error for invalid credentials', async ({ page }) => {
await page.fill('[data-testid="email"]', 'wrong@example.com');
await page.fill('[data-testid="password"]', 'wrong');
await page.click('[data-testid="submit"]');
await expect(page.locator('[data-testid="error"]')).toBeVisible();
});
});
```
## Fixtures
```typescript
// fixtures/auth.fixture.ts
import { test as base } from '@playwright/test';
export const test = base.extend({
authenticatedPage: async ({ page }, use) => {
await page.goto('/login');
await page.fill('[data-testid="email"]', 'test@example.com');
await page.fill('[data-testid="password"]', 'password');
await page.click('[data-testid="submit"]');
await page.waitForURL('/dashboard');
await use(page);
},
});
```
## Configuration
```typescript
// playwright.config.ts
export default defineConfig({
testDir: './tests',
retries: 2,
workers: 4,
use: {
baseURL: 'http://localhost:3000',
trace: 'on-first-retry',
screenshot: 'only-on-failure',
},
});
```
No comments yet. Be the first to comment!
Practical guide to testing web applications with screen readers for comprehensive accessibility validation.
克劳德代码会话的正式评估框架,实施评估驱动开发(EDD)原则
Go测试模式包括表格驱动测试、子测试、基准测试、模糊测试和测试覆盖率。遵循TDD方法论,采用地道的Go实践。
使用pytest、TDD方法、夹具、模拟、参数化和覆盖率要求的Python测试策略。
在编写新功能、修复错误或重构代码时使用此技能。强制执行测试驱动开发,包含单元测试、集成测试和端到端测试,覆盖率超过80%。