剧作家测试
- 作者仓库星标 34,831
- 作者仓库 posthog
- 领域
- 人工智能
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @PostHog · 未声明许可证
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 运行环境要求
- 未检出明确要求
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 命令执行
- 网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
步骤 1:计划要完成的测试。
使用 Playwright MCP 工具(例如,`mcp__playwright__browser_navigate`、`mcp__playwright__browser_click`、`mcp__playwright__browser_screenshot`)与浏览器交互并计划测试。探索之后,请将计划提交给我以供确认或进行任何更改。
第 2 步:实施测试计划
编写测试,确保使用相邻文件中使用的常见模式。使用 `BASE_URL='http://localhost:8010' pnpm --filter=@posthog/playwright exec playwright test <file name> --retries 0 --workers 3` 运行测试,调试任何失败。查看屏幕截图,如果需要启动剧作家 mcp 技能与浏览器交互。尝试修复后返回步骤 1。
第 3 步:确保没有不稳定的测试
文件中的所有测试通过后,在命令中添加 `--repeat-each 10` 来运行。这将暴露任何不稳定的测试。如果任何测试在 10 次运行中失败,请将其视为真正的失败:返回到步骤 2,调试、修复并重新运行步骤 3。在每个测试的每次运行都通过之前,不要继续执行步骤 4。
第四步:报告
一旦所有测试通过,输出一行:测试完成
Read @playwright/README.md for best practices, gotchas, and how to run tests.
## Rules
- Follow the best practices in the README strictly
- After UI interactions, always assert on UI changes, do not assert on network requests resolving
- **Keep looping until all tests pass.** Do not give up or ask the user for help. You must resolve every failure yourself.
## Instructions
You are to plan an end to end playwright test for a feature.
### Step 1: Plan the test(s) to be done.
Use the Playwright MCP tools (e.g., `mcp__playwright__browser_navigate`, `mcp__playwright__browser_click`, `mcp__playwright__browser_screenshot`) to interact with the browser and plan your tests.
After your exploration, present the plan to me for confirmation or any changes.
### Step 2: Implement the test plan
- Write the tests, making sure to use common patterns used in neighbouring files.
- Run the tests with `BASE_URL='http://localhost:8010' pnpm --filter=@posthog/playwright exec playwright test <file name> --retries 0 --workers 3`
- Debug any failures. Look at screen shots, if needed launch the playwright mcp skills to interact with the browser. Go back to step 1 after attempting a fix.
### Step 3: Ensure no flaky tests
After all tests pass in the file, run with `--repeat-each 10` added to the command. This will surface any flaky tests.
If any test fails across the 10 runs, treat it as a real failure: go back to Step 2, debug, fix, and re-run Step 3. Do not proceed to Step 4 until every run of every test passes.
### Step 4: Report
Once all tests pass, output a single line: **Testing Complete**
章节与文件索引
按说明文件中的顺序排列。
规则
步骤 1:计划要完成的测试。
第 2 步:实施测试计划
第 3 步:确保没有不稳定的测试
第四步:报告
文件/命令 -> mcp__playwright__browser_navigate · mcp__playwright__browser_click · mcp__playwright__browser_screenshot · --repeat-each 10
内容校验值 -> 837d6d339b6f
当前原文的自动摘译,尚未人工审校。
规则
严格遵循 README 中的最佳实践 UI 交互后,始终对 UI 更改进行断言,不要对网络请求进行断言,解决保持循环,直到所有测试通过。不要放弃或向用户寻求帮助。你必须自己解决每一次失败。