e2e-testing-patterns
它能做什么
这个工具帮你创建自动化测试,用来检查网站或应用是否正常工作。当你做出修改时,它能确保功能不会被破坏,让你更有信心地发布新版本。
适用场景
- ✓需要创建自动化测试来检查网站功能时。
- ✓明明应该通过的测试却莫名其妙地失败时。
- ✓想确保网站最关键的部分始终正常运行时。
技能链接
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/e2e-testing-patterns/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我怎样测试:输入错误密码时,登录会正确地失败?”
每周 5 个新技能,1 分钟读完。
工作原理
它的工作方式是定义用户会执行的步骤,比如点击按钮、填写表单,然后检查结果是否符合预期。整个过程自动完成,可以快速测试大量场景。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
E2E Testing Patterns
Build reliable, fast, and maintainable end-to-end test suites that provide confidence to ship code quickly and catch regressions before users do.
Use this skill when
- Implementing end-to-end test automation
- Debugging flaky or unreliable tests
- Testing critical user workflows
- Setting up CI/CD test pipelines
- Testing across multiple browsers
- Validating accessibility requirements
- Testing responsive designs
- Establishing E2E testing standards
Do not use this skill when
- You only need unit or integration tests
- The environment cannot support stable UI automation
- You cannot provision safe test accounts or data
Instructions
- Identify critical user journeys and success criteria.
- Build stable selectors and test data strategies.
- Implement isolated tests with observable assertions and tracing; diagnose retries rather than counting a retry as an ordinary pass.
- Run in CI with parallelization and artifact capture.
Safety
- Avoid running destructive tests against production.
- Use dedicated test data and scrub sensitive output.
Resources
resources/implementation-playbook.mdfor detailed E2E patterns and templates.
Worked example
Input: invalid login sometimes appears successful because the test reads the error before rendering finishes. Use a dedicated fixture account and assert await expect(page.getByRole('alert')).toContainText('Invalid credentials'). Run the test without retries and confirm the dashboard remains inaccessible. Expected: the failure state is observed reliably; a delayed error cannot silently pass.
Inputs and prerequisites
An authorized test URL, isolated accounts/data, the installed browser runner and known success/failure states. The playbook uses project-specific routes and adapters; install only the dependencies your existing suite needs.
Limitations
- A mocked backend or payment provider proves only the mocked boundary; retain separate real integration checks.
- Automated accessibility scans miss interaction and assistive-technology problems.
- Retries, larger timeouts and updated snapshots can hide regressions; preserve first-failure evidence.
- Browser tooling cannot validate a locked or unavailable interactive environment. Report that gap and continue independent tests.
常见问题
什么是端到端测试?
端到端测试模拟用户在网站或应用中的完整体验,从开始到完成一项任务的全过程。
为什么可靠的测试很重要?
可靠的测试能确保新的改动不会破坏已有功能,让你更有信心、更快地发布新版本。
什么是“不稳定”的测试?
指的是那些有时通过、有时失败,即使代码没有任何改动也会如此的测试。这样的测试很难让人信任。
详情
作者的原始描述
Build reliable, fast, and maintainable end-to-end test suites that provide confidence to ship code quickly and catch regressions before users do.
热度
- GitHub 星标
- 48k
- 排名
- #4503
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
00-andruia-consultant
48k帮你的智能体启动或改进 AI 项目。它可以分析代码、推荐工具,并用西班牙语制定行动计划。
007
48k让你的智能体执行安全审计和威胁建模。它有助于保护项目免受攻击和漏洞的威胁。
10-andruia-skill-smith
48k帮你的智能体创建或改进 AI 工具。它可以定义工具的工作方式、编写文档,并验证其结构。
20-andruia-niche-intelligence
48k让你的智能体创建某个特定行业的摘要。它有助于借助可靠的信息来源,了解项目的背景、规则、使用模式和风险。