跳到正文
Skillpedia
测试48k · #4503

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。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/e2e-testing-patterns/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 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

  1. Identify critical user journeys and success criteria.
  2. Build stable selectors and test data strategies.
  3. Implement isolated tests with observable assertions and tracing; diagnose retries rather than counting a retry as an ordinary pass.
  4. 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.md for 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.

repo: sickn33/agentic-awesome-skills

热度

GitHub 星标
48k
排名
#4503
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能