一键导入
playwright
Browser automation for testing with Playwright - navigate pages, interact with elements, take screenshots, and verify UI behavior
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Browser automation for testing with Playwright - navigate pages, interact with elements, take screenshots, and verify UI behavior
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Author runnable TypeScript workflows for OpenCode. Use when creating reusable executable flows under .opencode/workflows or when asked how to write, structure, debug, or invoke a workflow. Triggers on: write a workflow, create workflow, workflow authoring, /workflow, .opencode/workflows.
Run an ultrawork test-fix loop: read the ledger, select the highest-priority unresolved failure, diagnose and fix it, verify it, update the ledger, and continue until all entries are fixed or a blocking escalation stops the run. Use when you need to keep fixing test failures from a ledger. Triggers on: test-fix-round, test-fix-loop, fix test ledger, fix next test, ultrawork test fix.
Review OpenTUI/Solid TUI code for invalid text renderables that can crash TextNodeRenderable handling.
Generate a Product Requirements Document (PRD) for a new feature. Use when planning a feature, starting a new project, or when asked to create a PRD. Triggers on: create a prd, write prd for, plan this feature, requirements for, spec out.
Convert PRDs to prd.json format for the Ralph autonomous agent system. Use when you have an existing PRD and need to convert it to Ralph's JSON format. Triggers on: convert this prd, turn this into ralph format, create prd.json from this, ralph json.
Run typecheck and build, extract only errors, and return a concise pass/fail report. Use before tests to catch compile/resolve errors early. Triggers on: build-verify, verify build, check build, typecheck.
| name | playwright |
| description | Browser automation for testing with Playwright - navigate pages, interact with elements, take screenshots, and verify UI behavior |
You are a browser automation assistant using Playwright for testing and verification.
## SetupEnsure Playwright is installed in the project:
npx playwright install chromium
import { chromium } from 'playwright'
const browser = await chromium.launch()
const page = await browser.newPage()
await page.goto('http://localhost:3000')
await page.waitForLoadState('networkidle')
// Click buttons/links
await page.click('button:has-text("Submit")')
await page.click('[data-testid="login-btn"]')
// Fill forms
await page.fill('input[name="email"]', 'user@example.com')
await page.fill('input[name="password"]', 'password123')
// Select dropdowns
await page.selectOption('select#role', 'admin')
// Check/uncheck
await page.check('input[type="checkbox"]')
// Text content
await expect(page.locator('h1')).toHaveText('Dashboard')
// Visibility
await expect(page.locator('.error')).toBeVisible()
await expect(page.locator('.spinner')).toBeHidden()
// URL
await expect(page).toHaveURL(/.*dashboard/)
// Count
await expect(page.locator('li.item')).toHaveCount(5)
// Full page
await page.screenshot({ path: 'screenshot.png', fullPage: true })
// Specific element
await page.locator('.chart').screenshot({ path: 'chart.png' })
// Wait for navigation
await page.waitForURL('**/dashboard')
// Wait for element
await page.waitForSelector('.loaded')
// Wait for network
await page.waitForResponse(resp => resp.url().includes('/api/data'))
[data-testid="..."] - most reliablerole=button[name="..."] - accessibletext="..." - readable but fragile.class-name - depends on styling