playwright by pproenca/dot-skills
npx skills add https://github.com/pproenca/dot-skills --skill playwright适用于 Playwright 与 Next.js 应用程序的全面测试优化指南。包含 8 个类别共 43 条规则,按影响优先级排序,旨在指导编写可靠、快速且可维护的端到端测试。
在以下情况下参考本指南:
| 优先级 | 类别 | 影响 | 前缀 |
|---|---|---|---|
| 1 | 测试架构 | 关键 | arch- |
| 2 | 选择器与定位器 | 关键 | loc- |
| 3 | 等待与断言 | 高 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
wait- |
| 4 | 认证与状态 | 高 | auth- |
| 5 | 模拟与网络 | 中高 | mock- |
| 6 | Next.js 集成 | 中 | next- |
| 7 | 性能与速度 | 中 | perf- |
| 8 | 调试与 CI | 低中 | debug- |
arch-test-isolation - 为每个测试使用全新的浏览器上下文arch-parallel-execution - 启用并行测试执行arch-page-object-model - 为复杂页面使用页面对象模型arch-fixtures - 使用夹具进行共享设置arch-test-production - 针对生产构建进行测试arch-cleanup-state - 在每个测试后清理测试状态loc-role-selectors - 使用基于角色的选择器而非 CSSloc-data-testid - 为动态元素使用 data-testidloc-label-selectors - 为表单输入使用 getByLabelloc-text-selectors - 为静态内容使用 getByTextloc-avoid-xpath - 避免使用 XPath 选择器loc-chained-locators - 链式定位器以提高特异性loc-placeholder-selector - 谨慎使用 getByPlaceholderwait-web-first-assertions - 使用 web-first 断言wait-avoid-hard-waits - 避免硬性等待wait-network-idle - 为复杂页面使用网络空闲等待wait-action-retries - 让操作在交互前自动等待wait-soft-assertions - 为非关键检查使用软断言wait-custom-timeout - 适当配置超时时间auth-storage-state - 利用存储状态复用认证auth-multiple-roles - 为不同角色使用独立的存储状态auth-session-storage - 处理认证的会话存储auth-api-login - 使用 API 登录以加快认证设置auth-parallel-workers - 为并行测试使用工作线程范围的认证mock-api-responses - 模拟 API 响应以实现确定性测试mock-intercept-modify - 拦截并修改真实响应mock-har-files - 为复杂的模拟场景使用 HAR 文件mock-abort-requests - 中止不必要的请求mock-network-conditions - 模拟网络条件next-wait-hydration - 在交互前等待水合完成next-server-components - 正确测试服务器组件next-app-router-navigation - 测试 App Router 导航模式next-server-actions - 端到端测试服务器操作next-baseurl-config - 配置 baseURL 以实现简洁的导航perf-sharding - 为大型测试套件使用分片perf-headless-ci - 在 CI 中使用无头模式perf-browser-selection - 策略性地选择浏览器perf-reuse-server - 尽可能复用开发服务器perf-retries - 为不稳定测试的恢复配置重试debug-trace-viewer - 为失败的测试使用跟踪查看器debug-screenshots-videos - 在失败时捕获截图和视频debug-inspector - 使用 Playwright Inspector 进行交互式调试debug-ci-reporters - 为 CI 集成配置报告器阅读各个参考文件以获取详细解释和代码示例:
| 文件 | 描述 |
|---|---|
| AGENTS.md | 包含所有规则的完整编译指南 |
| references/_sections.md | 类别定义和排序 |
| assets/templates/_template.md | 新规则模板 |
| metadata.json | 版本和参考信息 |
每周安装量
180
代码仓库
GitHub 星标数
85
首次出现
2026年1月22日
安全审计
安装于
gemini-cli154
opencode150
codex149
claude-code144
cursor140
github-copilot139
Comprehensive testing optimization guide for Playwright with Next.js applications. Contains 43 rules across 8 categories, prioritized by impact to guide reliable, fast, and maintainable E2E tests.
Reference these guidelines when:
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Test Architecture | CRITICAL | arch- |
| 2 | Selectors & Locators | CRITICAL | loc- |
| 3 | Waiting & Assertions | HIGH | wait- |
| 4 | Authentication & State | HIGH | auth- |
| 5 | Mocking & Network | MEDIUM-HIGH | mock- |
| 6 | Next.js Integration | MEDIUM | next- |
| 7 | Performance & Speed | MEDIUM | perf- |
| 8 | Debugging & CI | LOW-MEDIUM | debug- |
arch-test-isolation - Use fresh browser context for each testarch-parallel-execution - Enable parallel test executionarch-page-object-model - Use Page Object Model for complex pagesarch-fixtures - Use fixtures for shared setuparch-test-production - Test against production buildsarch-cleanup-state - Clean up test state after each testloc-role-selectors - Use role-based selectors over CSSloc-data-testid - Use data-testid for dynamic elementsloc-label-selectors - Use getByLabel for form inputsloc-text-selectors - Use getByText for static contentloc-avoid-xpath - Avoid XPath selectorsloc-chained-locators - Chain locators for specificitywait-web-first-assertions - Use web-first assertionswait-avoid-hard-waits - Avoid hard waitswait-network-idle - Use network idle for complex pageswait-action-retries - Let actions auto-wait before interactingwait-soft-assertions - Use soft assertions for non-critical checkswait-custom-timeout - Configure timeouts appropriatelyauth-storage-state - Reuse authentication with storage stateauth-multiple-roles - Use separate storage states for different rolesauth-session-storage - Handle session storage for authauth-api-login - Use API login for faster auth setupauth-parallel-workers - Use worker-scoped auth for parallel testsmock-api-responses - Mock API responses for deterministic testsmock-intercept-modify - Intercept and modify real responsesmock-har-files - Use HAR files for complex mock scenariosmock-abort-requests - Abort unnecessary requestsmock-network-conditions - Simulate network conditionsnext-wait-hydration - Wait for hydration before interactingnext-server-components - Test server components correctlynext-app-router-navigation - Test App Router navigation patternsnext-server-actions - Test server actions end-to-endnext-baseurl-config - Configure baseURL for clean navigationperf-sharding - Use sharding for large test suitesperf-headless-ci - Use headless mode in CIperf-browser-selection - Select browsers strategicallyperf-reuse-server - Reuse development server when possibleperf-retries - Configure retries for flaky test recoverydebug-trace-viewer - Use trace viewer for failed testsdebug-screenshots-videos - Capture screenshots and videos on failuredebug-inspector - Use Playwright Inspector for interactive debuggingdebug-ci-reporters - Configure reporters for CI integrationRead individual reference files for detailed explanations and code examples:
| File | Description |
|---|---|
| AGENTS.md | Complete compiled guide with all rules |
| references/_sections.md | Category definitions and ordering |
| assets/templates/_template.md | Template for new rules |
| metadata.json | Version and reference information |
Weekly Installs
180
Repository
GitHub Stars
85
First Seen
Jan 22, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
gemini-cli154
opencode150
codex149
claude-code144
cursor140
github-copilot139
Skills CLI 使用指南:AI Agent 技能包管理器安装与管理教程
33,600 周安装
loc-placeholder-selector - Use getByPlaceholder sparingly