e2e-testing-automation by aj-geddes/useful-ai-prompts
npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill e2e-testing-automation端到端测试从用户界面出发,贯穿所有后端系统,验证完整的用户工作流程,确保从用户视角来看,整个应用栈能协同工作。E2E 测试模拟真实用户与浏览器的交互,处理身份验证、导航、表单提交并验证结果。
最小工作示例:
// tests/e2e/checkout.spec.ts
import { test, expect, Page } from "@playwright/test";
test.describe("E-commerce Checkout Flow", () => {
let page: Page;
test.beforeEach(async ({ page: p }) => {
page = p;
await page.goto("/");
});
test("complete checkout flow as guest user", async () => {
// 1. 浏览并将商品加入购物车
await page.click("text=Shop Now");
await page.click('[data-testid="product-1"]');
await expect(page.locator("h1")).toContainText("Product Name");
await page.click('button:has-text("Add to Cart")');
await expect(page.locator(".cart-count")).toHaveText("1");
// 2. 前往购物车并继续结账
await page.click('[data-testid="cart-icon"]');
await expect(page.locator(".cart-item")).toHaveCount(1);
await page.click("text=Proceed to Checkout");
// ... (完整实现请参阅参考指南)
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
references/ 目录下的详细实现:
| 指南 | 内容 |
|---|---|
| Playwright E2E 测试 | Playwright E2E 测试 |
| Cypress E2E 测试 | Cypress E2E 测试 |
| Selenium with Python (pytest) | Selenium with Python (pytest) |
| 页面对象模型模式 | 页面对象模型模式 |
每周安装次数
178
代码仓库
GitHub 星标数
126
首次出现
2026年1月21日
安全审计
安装于
opencode155
gemini-cli145
codex141
cursor141
claude-code136
github-copilot125
End-to-end (E2E) testing validates complete user workflows from the UI through all backend systems, ensuring the entire application stack works together correctly from a user's perspective. E2E tests simulate real user interactions with browsers, handling authentication, navigation, form submissions, and validating results.
Minimal working example:
// tests/e2e/checkout.spec.ts
import { test, expect, Page } from "@playwright/test";
test.describe("E-commerce Checkout Flow", () => {
let page: Page;
test.beforeEach(async ({ page: p }) => {
page = p;
await page.goto("/");
});
test("complete checkout flow as guest user", async () => {
// 1. Browse and add product to cart
await page.click("text=Shop Now");
await page.click('[data-testid="product-1"]');
await expect(page.locator("h1")).toContainText("Product Name");
await page.click('button:has-text("Add to Cart")');
await expect(page.locator(".cart-count")).toHaveText("1");
// 2. Go to cart and proceed to checkout
await page.click('[data-testid="cart-icon"]');
await expect(page.locator(".cart-item")).toHaveCount(1);
await page.click("text=Proceed to Checkout");
// ... (see reference guides for full implementation)
Detailed implementations in the references/ directory:
| Guide | Contents |
|---|---|
| Playwright E2E Tests | Playwright E2E Tests |
| Cypress E2E Tests | Cypress E2E Tests |
| Selenium with Python (pytest) | Selenium with Python (pytest) |
| Page Object Model Pattern | Page Object Model Pattern |
Weekly Installs
178
Repository
GitHub Stars
126
First Seen
Jan 21, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode155
gemini-cli145
codex141
cursor141
claude-code136
github-copilot125
通过 LiteLLM 代理让 Claude Code 对接 GitHub Copilot 运行 | 高级变通方案指南
29,800 周安装