[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6FEES4GY2GSV3M001SAGBAR":3,"skill-same:01M6FEES4GY2GSV3M001SAGBAR":45},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":20,"frontMatter":21,"refName":22,"commitSha":23,"skillDirectory":24,"forksCount":25,"repositoryHtmlUrl":26,"repositoryHomepageUrl":27,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":29,"updatedAt":30,"install":31,"resources":44},"01M6FEES4GY2GSV3M001SAGBAR","playwright",null,"ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fpproenca\u002Fdot-skills\u002Fplaywright\u002FSKILL.md",[],[5],"2026-11-10 10:12:30",false,"# Playwright + Next.js Testing Best Practices\n\nComprehensive 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.\n\n## When to Apply\n\nReference these guidelines when:\n- Writing new Playwright tests for Next.js apps\n- Debugging flaky or failing tests\n- Optimizing test execution speed\n- Setting up authentication state reuse\n- Configuring CI\u002FCD pipelines for testing\n- Testing Server Components and App Router features\n- Reviewing test code for reliability issues\n\n## Rule Categories by Priority\n\n| Priority | Category | Impact | Prefix |\n|----------|----------|--------|--------|\n| 1 | Test Architecture | CRITICAL | `arch-` |\n| 2 | Selectors & Locators | CRITICAL | `loc-` |\n| 3 | Waiting & Assertions | HIGH | `wait-` |\n| 4 | Authentication & State | HIGH | `auth-` |\n| 5 | Mocking & Network | MEDIUM-HIGH | `mock-` |\n| 6 | Next.js Integration | MEDIUM | `next-` |\n| 7 | Performance & Speed | MEDIUM | `perf-` |\n| 8 | Debugging & CI | LOW-MEDIUM | `debug-` |\n\n## Quick Reference\n\n### 1. Test Architecture (CRITICAL)\n\n- [`arch-test-isolation`](references\u002Farch-test-isolation.md) - Use fresh browser context for each test\n- [`arch-parallel-execution`](references\u002Farch-parallel-execution.md) - Enable parallel test execution\n- [`arch-page-object-model`](references\u002Farch-page-object-model.md) - Use Page Object Model for complex pages\n- [`arch-fixtures`](references\u002Farch-fixtures.md) - Use fixtures for shared setup\n- [`arch-test-production`](references\u002Farch-test-production.md) - Test against production builds\n- [`arch-cleanup-state`](references\u002Farch-cleanup-state.md) - Clean up test state after each test\n\n### 2. Selectors & Locators (CRITICAL)\n\n- [`loc-role-selectors`](references\u002Floc-role-selectors.md) - Use role-based selectors over CSS\n- [`loc-data-testid`](references\u002Floc-data-testid.md) - Use data-testid for dynamic elements\n- [`loc-label-selectors`](references\u002Floc-label-selectors.md) - Use getByLabel for form inputs\n- [`loc-text-selectors`](references\u002Floc-text-selectors.md) - Use getByText for static content\n- [`loc-avoid-xpath`](references\u002Floc-avoid-xpath.md) - Avoid XPath selectors\n- [`loc-chained-locators`](references\u002Floc-chained-locators.md) - Chain locators for specificity\n- [`loc-placeholder-selector`](references\u002Floc-placeholder-selector.md) - Use getByPlaceholder sparingly\n\n### 3. Waiting & Assertions (HIGH)\n\n- [`wait-web-first-assertions`](references\u002Fwait-web-first-assertions.md) - Use web-first assertions\n- [`wait-avoid-hard-waits`](references\u002Fwait-avoid-hard-waits.md) - Avoid hard waits\n- [`wait-network-idle`](references\u002Fwait-network-idle.md) - Use network idle for complex pages\n- [`wait-action-retries`](references\u002Fwait-action-retries.md) - Let actions auto-wait before interacting\n- [`wait-soft-assertions`](references\u002Fwait-soft-assertions.md) - Use soft assertions for non-critical checks\n- [`wait-custom-timeout`](references\u002Fwait-custom-timeout.md) - Configure timeouts appropriately\n\n### 4. Authentication & State (HIGH)\n\n- [`auth-storage-state`](references\u002Fauth-storage-state.md) - Reuse authentication with storage state\n- [`auth-multiple-roles`](references\u002Fauth-multiple-roles.md) - Use separate storage states for different roles\n- [`auth-session-storage`](references\u002Fauth-session-storage.md) - Handle session storage for auth\n- [`auth-api-login`](references\u002Fauth-api-login.md) - Use API login for faster auth setup\n- [`auth-parallel-workers`](references\u002Fauth-parallel-workers.md) - Use worker-scoped auth for parallel tests\n\n### 5. Mocking & Network (MEDIUM-HIGH)\n\n- [`mock-api-responses`](references\u002Fmock-api-responses.md) - Mock API responses for deterministic tests\n- [`mock-intercept-modify`](references\u002Fmock-intercept-modify.md) - Intercept and modify real responses\n- [`mock-har-files`](references\u002Fmock-har-files.md) - Use HAR files for complex mock scenarios\n- [`mock-abort-requests`](references\u002Fmock-abort-requests.md) - Abort unnecessary requests\n- [`mock-network-conditions`](references\u002Fmock-network-conditions.md) - Simulate network conditions\n\n### 6. Next.js Integration (MEDIUM)\n\n- [`next-wait-hydration`](references\u002Fnext-wait-hydration.md) - Wait for hydration before interacting\n- [`next-server-components`](references\u002Fnext-server-components.md) - Test server components correctly\n- [`next-app-router-navigation`](references\u002Fnext-app-router-navigation.md) - Test App Router navigation patterns\n- [`next-server-actions`](references\u002Fnext-server-actions.md) - Test server actions end-to-end\n- [`next-baseurl-config`](references\u002Fnext-baseurl-config.md) - Configure baseURL for clean navigation\n\n### 7. Performance & Speed (MEDIUM)\n\n- [`perf-sharding`](references\u002Fperf-sharding.md) - Use sharding for large test suites\n- [`perf-headless-ci`](references\u002Fperf-headless-ci.md) - Use headless mode in CI\n- [`perf-browser-selection`](references\u002Fperf-browser-selection.md) - Select browsers strategically\n- [`perf-reuse-server`](references\u002Fperf-reuse-server.md) - Reuse development server when possible\n- [`perf-retries`](references\u002Fperf-retries.md) - Configure retries for flaky test recovery\n\n### 8. Debugging & CI (LOW-MEDIUM)\n\n- [`debug-trace-viewer`](references\u002Fdebug-trace-viewer.md) - Use trace viewer for failed tests\n- [`debug-screenshots-videos`](references\u002Fdebug-screenshots-videos.md) - Capture screenshots and videos on failure\n- [`debug-inspector`](references\u002Fdebug-inspector.md) - Use Playwright Inspector for interactive debugging\n- [`debug-ci-reporters`](references\u002Fdebug-ci-reporters.md) - Configure reporters for CI integration\n\n## How to Use\n\nRead individual reference files for detailed explanations and code examples:\n\n- [Section definitions](references\u002F_sections.md) - Category structure and impact levels\n- [Rule template](assets\u002Ftemplates\u002F_template.md) - Template for adding new rules\n\n## Reference Files\n\n| File | Description |\n|------|-------------|\n| [AGENTS.md](AGENTS.md) | Complete compiled guide with all rules |\n| [references\u002F_sections.md](references\u002F_sections.md) | Category definitions and ordering |\n| [assets\u002Ftemplates\u002F_template.md](assets\u002Ftemplates\u002F_template.md) | Template for new rules |\n| [metadata.json](metadata.json) | Version and reference information |\n",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Fpproenca\u002Fdot-skills\u002Fplaywright",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":7,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill playwright",{"tool":37,"command":38},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill playwright",{"tool":40,"command":41},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill playwright","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fpproenca\u002Fdot-skills\u002Fplaywright\u002FSKILL.md",true,[],[46,55,64,73,79,85],{"skillNo":47,"name":48,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":49,"categories":50,"keywords":51,"publishedAt":18},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[],[52,53,54],"model","model hierarchy","model hierarchy skill",{"skillNo":56,"name":57,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":18},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[],[61,62,63],"MCP","zoom","zoom mcp",{"skillNo":65,"name":66,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":18},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[70,71,72,62],"sdk","zoom apps sdk","apps",{"skillNo":74,"name":75,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":18},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[75],{"skillNo":80,"name":81,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":18},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[],[81],{"skillNo":86,"name":87,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":18},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[87]]