安装热度榜

playwright-best-practices

汇总 Playwright 的选择器、夹具、并行执行和 CI 接入写法,便于写稳健测试与排查不稳定用例。

分类
测试验证
榜单排名
#3
安装量
56,580

它能做什么

中文摘要

「playwright-best-practices」的原始 GitHub SKILL.md 将它定位为:Use when writing Playwright tests, fixing flaky tests, debugging failures, implementing Page Object Model, configuring CI/CD, optimizing performance, mocking APIs, handling authentication or OAuth, testing accessibility (axe-core), file uploads/downloads, date/time mocking, WebSockets, geolocation, permissions, multi-tab/popup flows, mobile/responsive layouts, touch gestures, GraphQL, error。它的核心价值是把前端性能、渲染路径、数据获取和包体控制变成可执行检查清单;约束界面层级、组件状态、可访问性和视觉验收细节。文档重点章节包括「Activity-Based Reference Guide」「Writing New Tests」「Mobile & Responsive Testing」。

为什么推荐

推荐理由

推荐它,是因为它在「测试验证」分类里热度靠前(安装量 56,580),同时原始文档信息密度足够高。原文列出的执行要点包括:Review error output and trace (`npx playwright show-trace`);Fix locators, waits, or assertions。对经常重复的任务来说,这类 Skill 能把经验沉淀到工作流前端,减少临场猜测。

什么时候用

适用场景

  • 做界面实现、组件重构、视觉验收或设计系统一致性检查
  • 处理 Web 应用路由、部署、缓存、服务端渲染和生产问题
  • 建立测试闭环、回归验证、安全检查和发布前质量门

使用前先看

主要亮点

  • 01

    适合写测试、修复偶发失败、分析 trace 和错误输出。

  • 02

    覆盖 Page Object、认证、接口模拟、移动端与多标签页场景。

  • 03

    原文信息较全,但偏 Playwright 生态,不适合泛化到其他测试框架。

原始文档

原文摘录

Use when writing Playwright tests, fixing flaky tests, debugging failures, implementing Page Object Model, configuring CI/CD, optimizing performance, mocking APIs, handling authentication or OAuth, testing accessibility (axe-core), file uploads/downloads, date/time mocking, WebSockets, geolocation, permissions, multi-tab/popup flows, mobile/responsive layouts, touch gestures, GraphQL, error