playwright
Playwright browser automation API, web scraping, and tooling. Covers locator strategies, assertions, API testing, stealth mode, anti-bot bypass, authenticated sessions, screenshots/PDFs, Docker deployment, configuration, debugging, and MCP integration with AI agents. Prevents documented errors including CI timeout hangs, extension testing failures, and navigation issues. Use when automating browsers, scraping protected sites, bypassing bot detection, generating screenshots/PDFs, configuring Playwright Test, troubleshooting Playwright errors, or learning Playwright API patterns. For E2E test architecture, Page Object Models, CI sharding strategies, or test organization patterns, use the e2e-testing skill instead.
What this skill does
# Playwright
## Overview
Playwright is a browser automation framework for Node.js and Python supporting Chromium, Firefox, and WebKit with a single API. It provides auto-waiting, web-first assertions, and full test isolation for reliable end-to-end testing.
**When to use:** Browser automation, web scraping, screenshot/PDF generation, API testing, configuring Playwright Test, troubleshooting Playwright errors, stealth mode and anti-bot bypass.
**When NOT to use:** Simple HTTP requests (use `fetch`), unit testing (use Vitest/Jest), serverless scraping at scale (consider Cloudflare Browser Rendering). For E2E test architecture (Page Object Models, CI sharding, test organization, authentication patterns), use the `e2e-testing` skill.
## Quick Reference
| Pattern | API / Config | Key Points |
| --------------------- | ----------------------------------------------------- | -------------------------------------------------- |
| Basic test | `test('name', async ({ page }) => {})` | Auto-wait, web-first assertions, test isolation |
| Locator | `page.getByRole()` / `page.locator()` | Prefer role/label/text selectors over CSS |
| Assertion | `expect(locator).toBeVisible()` | Auto-retrying, configurable timeout |
| API testing | `request` fixture / `apiRequestContext` | Send HTTP requests, validate responses |
| Aria snapshot | `expect(locator).toMatchAriaSnapshot()` | Validate accessibility tree structure via YAML |
| Class assertion | `expect(locator).toContainClass('active')` | Match individual CSS class names (v1.52+) |
| Visible filter | `locator.filter({ visible: true })` | Match only visible elements (v1.51+) |
| Test step | `test.step('name', async (step) => {})` | Timeout, skip, and attachments (v1.50+) |
| Stealth mode | `playwright-extra` + stealth plugin | Patches 20+ detection vectors |
| Authenticated session | `context.cookies()` + `addCookies()` | Save/restore cookies and IndexedDB for persistence |
| Screenshot | `page.screenshot({ fullPage: true })` | Wait for key elements to load first |
| PDF generation | `page.pdf({ format: 'A4' })` | Chromium only, set `printBackground: true` |
| Clock API | `page.clock` | Freeze, fast-forward, or simulate time in tests |
| A11y assertions | `toHaveAccessibleName`, `toHaveRole` | Native assertions without axe-core dependency |
| Viewport assertion | `expect(locator).toBeInViewport()` | Assert element is within the visible viewport |
| Changed tests only | `--only-changed=$GITHUB_BASE_REF` | Run only test files changed since base branch |
| Docker | `mcr.microsoft.com/playwright:v1.58.2-noble` | Use `--init --ipc=host` flags |
| Debug methods | `page.consoleMessages()` / `page.requests()` (v1.56+) | No event listeners needed |
| Speedboard | HTML reporter (v1.57+) | Identifies slow tests and bottlenecks |
| Playwright Agents | `npx playwright init-agents` | Planner, generator, healer for LLM-driven testing |
| Flaky test detection | `--fail-on-flaky-tests` (v1.50+) | Exit code 1 on flaky tests in CI |
| Modify live responses | `route.fetch()` + `route.fulfill()` | Intercept real response, tweak JSON, return it |
| Soft assertions | `expect.soft(locator)` | Don't stop test on failure, report all at end |
| Retry block | `expect(async () => {}).toPass()` | Default timeout is 0 (forever) — always set one |
| Custom matchers | `expect.extend()` / `mergeExpects()` | Define or combine custom assertion methods |
| Actionability matrix | Per-action auto-wait checks | click: all 5 checks, fill: 3, focus/blur: none |
| Test modifiers | `test.fixme()` / `test.fail()` / `test.slow()` | fixme=skip+track, fail=assert failure, slow=3x |
| Parallel modes | `test.describe.configure({ mode: 'serial' })` | serial, parallel, or default per-describe block |
| Teardown projects | `teardown` option on setup projects | Auto-cleanup after all dependents finish |
## Common Mistakes
| Mistake | Correct Pattern |
| ----------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| Using CSS selectors over role selectors | Prefer `getByRole`, `getByLabel`, `getByText` for resilience |
| Not closing browser | Always `await browser.close()` in `finally` block |
| Using `setTimeout` for waits | Use locator auto-wait or `waitForLoadState` |
| `page.pause()` left in CI code | Guard with `if (!process.env.CI)` — hangs CI indefinitely |
| Clicking without waiting | Use `locator().click()` with built-in auto-wait |
| Shared state between tests | Each test gets fresh context via fixtures |
| Testing implementation details | Assert user-visible behavior, not DOM structure |
| Hardcoded waits for dynamic content | Wait for selector appearance or content stabilization |
| Missing `await` on assertions | All `expect()` assertions return promises — must be awaited |
| Same user agent for all scraping | Rotate user agents for high-volume scraping |
| Using `setTimeout` for time-dependent tests | Use `page.clock` API to freeze/fast-forward time |
| Installing axe-core for simple a11y checks | Use native `toHaveAccessibleName`/`toHaveRole` assertions |
| Using `toPass()` without explicit timeout | Always pass `{ timeout: 10_000 }` — default is 0 (forever) |
| Service worker silently blocking `page.route()` | Set `serviceWorkers: 'block'` in context config when using MSW |
| Using `fill()` for autocomplete/debounce inputs | Use `pressSequentially()` with optional delay for per-keystroke handling |
| `storageState` losing sessionStorage | `storageState` only saves cookies + localStorage — inject sessionStorage via `addInitScript()` |
## Delegation
- **Selector troubleshooting**: Use `Explore` agent
- **Test pattern review**: Use `Task` agent
- **Code review**: Delegate to `code-reviewer` agent
> For E2E test architecture, Page Object Model patterns, CI sharding strategies, authentication flows, visual regression workflows, or test organization, use the `e2e-testing` skilRelated in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.