Paste failing Playwright into the agent, not into Slack
说明与用途
在 Playwright e2e 调试过程中,团队在 Slack 中共享截图,导致定位错误原因变慢。通过将完整的失败块粘贴到 AI 助手中,他们快速获得了修复和根本原因说明。新流程复制所有错误信息,限制修改范围,并对问题类型进行分类,加速调试并降低 flakiness。
问题
Flaky Playwright e2e tests remain flaky because failure details are shared in Slack threads instead of being fed directly to an AI agent for debugging.
结果
The workflow reduced debugging time from 20 minutes to 10 minutes, prevented flaky tests from staying flaky, and ensured patches had clear root‑cause explanations.
工作流
- Reproduce locally once if CI is flaky-suspicious
- Paste the failure block and test file path into the agent, attach relevant page‑object file
- Constrain the edit: one test file, at most one page object, keep assertion intent, prefer getByRole over CSS
- Ask the agent for a hypothesis first, then the patch
- Re‑run the single test and paste the green output back
- Merge only after verifying the patch fixes the failure
证据
Someone screenshot the red CI job, dropped it in Slack, and three of us spent twenty minutes guessing which locator drifted.
Paste the raw Playwright error — stack, expected vs received, the page URL from the trace — into the agent and asked it to propose a one-file fix.
Agents fix tests when you give them the same artifacts you’d open yourself: the exact assertion message, the stack, the page URL, trace/screenshot path, command
- 记录日期: 2026-11-01T21:43:44.607Z