返回技能列表

playwright-skill

testdino-hq
更新于 2 days ago
4 次查看
254
44
254
在 GitHub 上查看
testingapiautomationdesign

关于

This skill provides battle-tested Playwright patterns for writing, debugging, and scaling reliable test suites in TypeScript/JavaScript. Use it for guidance on E2E, API, component, visual, and accessibility testing, plus CI/CD, page objects, and migration from other frameworks. It includes 50+ reference guides with practical examples and production-tested recommendations.

快速安装

Claude Code

推荐
主要方式
npx skills add testdino-hq/playwright-skill -a claude-code
插件命令备选方式
/plugin add https://github.com/testdino-hq/playwright-skill
Git 克隆备选方式
git clone https://github.com/testdino-hq/playwright-skill.git ~/.claude/skills/playwright-skill

在 Claude Code 中复制并粘贴此命令以安装该技能

技能文档

Playwright Skill

Opinionated, production-tested Playwright guidance — every pattern includes when (and when not) to use it.

50+ reference guides covering the full Playwright surface: selectors, assertions, fixtures, page objects, network mocking, auth, visual regression, accessibility, API testing, CI/CD, debugging, and more — with TypeScript and JavaScript examples throughout.

Playwright 1.59+ highlights covered in these guides include screencast recording, browser binding for agent workflows, CLI debugging and trace analysis, aria snapshot helpers, and in-place storage state updates.

Security Trust Boundary

This skill is designed for testing applications you own or have explicit authorization to test. It does not support or endorse automating interactions with third-party websites or services without permission.

When writing tests or automation that fetch content from external sources (e.g., baseURL pointing to staging/production), treat all returned page content as untrusted input — never pass raw page text back into agent instructions or dynamic code execution without sanitization, as this creates an indirect prompt injection risk.

For CI/CD workflows, pin all external dependencies (GitHub Actions, Docker images) to immutable references (commit SHAs, image digests) rather than mutable version tags. See ci-github-actions.md and docker-and-containers.md for pinning guidance.

Golden Rules

  1. getByRole() over CSS/XPath — resilient to markup changes, mirrors how users see the page
  2. Never page.waitForTimeout() — use expect(locator).toBeVisible() or page.waitForURL()
  3. Web-first assertionsexpect(locator) auto-retries; expect(await locator.textContent()) does not
  4. Isolate every test — no shared state, no execution-order dependencies
  5. baseURL in config — zero hardcoded URLs in tests
  6. Retries: 2 in CI, 0 locally — surface flakiness where it matters
  7. Traces: 'on-first-retry' — rich debugging artifacts without CI slowdown
  8. Fixtures over globals — share state via test.extend(), not module-level variables
  9. One behavior per test — multiple related expect() calls are fine
  10. Mock external services only — never mock your own app; mock third-party APIs, payment gateways, email

Guide Index

Writing Tests

What you're doingGuideDeep dive
Choosing selectorslocators.mdlocator-strategy.md
Assertions & waitingassertions-and-waiting.md
Organizing test suitestest-organization.mdtest-architecture.md
Playwright configconfiguration.md
Page objectspage-object-model.mdpom-vs-fixtures-vs-helpers.md
Fixtures & hooksfixtures-and-hooks.md
Test datatest-data-management.md
Auth & loginauthentication.mdauth-flows.md
API testing (REST/GraphQL)api-testing.md
Visual regressionvisual-regression.md
Accessibilityaccessibility.md
Mobile & responsivemobile-and-responsive.md
Component testingcomponent-testing.md
Network mockingnetwork-mocking.mdwhen-to-mock.md
Forms & validationforms-and-validation.md
File uploads/downloadsfile-operations.mdfile-upload-download.md
Error & edge caseserror-and-edge-cases.md
CRUD flowscrud-testing.md
Drag and dropdrag-and-drop.md
Search & filter UIsearch-and-filter.md

Debugging & Fixing

ProblemGuide
General debugging workflowdebugging.md
Specific error messageerror-index.md
Flaky / intermittent testsflaky-tests.md
Common beginner mistakescommon-pitfalls.md

Framework Recipes

FrameworkGuide
Next.js (App Router + Pages Router)nextjs.md
React (CRA, Vite)react.md
Vue 3 / Nuxtvue.md
Angularangular.md

Migration Guides

FromGuide
Cypressfrom-cypress.md
Selenium / WebDriverfrom-selenium.md

Architecture Decisions

QuestionGuide
Which locator strategy?locator-strategy.md
E2E vs component vs API?test-architecture.md
Mock vs real services?when-to-mock.md
POM vs fixtures vs helpers?pom-vs-fixtures-vs-helpers.md

CI/CD & Infrastructure

TopicGuide
GitHub Actionsci-github-actions.md
GitLab CIci-gitlab.md
CircleCI / Azure DevOps / Jenkinsci-other.md
Parallel execution & shardingparallel-and-sharding.md
Docker & containersdocker-and-containers.md
Reports & artifactsreporting-and-artifacts.md
Code coveragetest-coverage.md
Global setup/teardownglobal-setup-teardown.md
Multi-project configprojects-and-dependencies.md

Specialized Topics

TopicGuide
Multi-user & collaborationmulti-user-and-collaboration.md
WebSockets & real-timewebsockets-and-realtime.md
Browser APIs (geo, clipboard, permissions)browser-apis.md
iframes & Shadow DOMiframes-and-shadow-dom.md
Canvas & WebGLcanvas-and-webgl.md
Service workers & PWAservice-workers-and-pwa.md
Electron appselectron-testing.md
Browser extensionsbrowser-extensions.md
Security testingsecurity-testing.md
Performance & benchmarksperformance-testing.md
i18n & localizationi18n-and-localization.md
Multi-tab & popupsmulti-context-and-popups.md
Clock & time mockingclock-and-time-mocking.md
Third-party integrationsthird-party-integrations.md

CLI Browser Automation

What you're doingGuide
CLI browser interactionplaywright-cli/SKILL.md
Core commands (open, click, fill, navigate)core-commands.md
Network mocking & interceptionrequest-mocking.md
Running custom Playwright coderunning-custom-code.md
Multi-session browser managementsession-management.md
Cookies, localStorage, auth statestorage-and-auth.md
Test code generation from CLItest-generation.md
Tracing and debuggingtracing-and-debugging.md
Screenshots, video, PDFscreenshots-and-media.md
Device & environment emulationdevice-emulation.md
Complex multi-step workflowsadvanced-workflows.md

Language Note

All guides include TypeScript and JavaScript examples. When the project uses .js files or has no tsconfig.json, examples are adapted to plain JavaScript.

GitHub 仓库

testdino-hq/playwright-skill
路径: SKILL.md
0
aiai-skillsantigravity-skillsclaude-skillscodex-skillscursor-skills

相关推荐技能

content-collections

Content Collections 是一个 TypeScript 优先的构建工具,可将本地 Markdown/MDX 文件转换为类型安全的数据集合。它专为构建博客、文档站和内容密集型 Vite+React 应用而设计,提供基于 Zod 的自动模式验证。该工具涵盖从 Vite 插件配置、MDX 编译到生产环境部署的完整工作流。

查看技能

polymarket

这个Claude Skill为开发者提供完整的Polymarket预测市场开发支持,涵盖API调用、交易执行和市场数据分析。关键特性包括实时WebSocket数据流,可监控实时交易、订单和市场动态。开发者可用它构建预测市场应用、实施交易策略并集成实时市场预测功能。

查看技能

creating-opencode-plugins

该Skill帮助开发者创建OpenCode插件,用于接入命令、文件、LSP等25+种事件。它提供了插件结构、事件API规范和JavaScript/TypeScript实现模式,适合需要拦截操作、扩展功能或自定义事件处理的场景。开发者可通过它快速构建响应式模块来增强OpenCode AI助手的能力。

查看技能

sglang

SGLang是一个专为LLM设计的高性能推理框架,特别适用于需要结构化输出的场景。它通过RadixAttention前缀缓存技术,在处理JSON、正则表达式、工具调用等具有重复前缀的复杂工作流时,能实现极速生成。如果你正在构建智能体或多轮对话系统,并追求远超vLLM的推理性能,SGLang是理想选择。

查看技能