E2E Testing Automation

E2E Testing Automation

Guides an AI agent to build end-to-end browser tests with Playwright, Cypress and Selenium, using page objects to cover user journeys like checkout.

Skill files7 files

references/

scripts/

templates/

SKILL.md100 lines
1
---
2
name: e2e-testing-automation
3
description: >
4
Build end-to-end automated tests that simulate real user interactions across
5
the full application stack. Use for E2E test, Selenium, Cypress, Playwright,
6
browser automation, and user journey testing.
7
---
8
9
# E2E Testing Automation
10
11
## Table of Contents
12
13
- [Overview](#overview)
14
- [When to Use](#when-to-use)
15
- [Quick Start](#quick-start)
16
- [Reference Guides](#reference-guides)
17
- [Best Practices](#best-practices)
18
19
## Overview
20
21
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.
22
23
## When to Use
24
25
- Testing critical user journeys (signup, checkout, login)
26
- Validating multi-step workflows
27
- Testing across different browsers and devices
28
- Regression testing for UI changes
29
- Verifying frontend-backend integration
30
- Testing with real user interactions (clicks, typing, scrolling)
31
- Smoke testing deployments
32
33
## Quick Start
34
35
Minimal working example:
36
37
```typescript
38
// tests/e2e/checkout.spec.ts
39
import { test, expect, Page } from "@playwright/test";
40
41
test.describe("E-commerce Checkout Flow", () => {
42
let page: Page;
43
44
test.beforeEach(async ({ page: p }) => {
45
page = p;
46
await page.goto("/");
47
});
48
49
test("complete checkout flow as guest user", async () => {
50
// 1. Browse and add product to cart
51
await page.click("text=Shop Now");
52
await page.click('[data-testid="product-1"]');
53
await expect(page.locator("h1")).toContainText("Product Name");
54
55
await page.click('button:has-text("Add to Cart")');
56
await expect(page.locator(".cart-count")).toHaveText("1");
57
58
// 2. Go to cart and proceed to checkout
59
await page.click('[data-testid="cart-icon"]');
60
await expect(page.locator(".cart-item")).toHaveCount(1);
61
await page.click("text=Proceed to Checkout");
62
63
// ... (see reference guides for full implementation)
64
```
65
66
## Reference Guides
67
68
Detailed implementations in the `references/` directory:
69
70
| Guide | Contents |
71
|---|---|
72
| [Playwright E2E Tests](references/playwright-e2e-tests.md) | Playwright E2E Tests |
73
| [Cypress E2E Tests](references/cypress-e2e-tests.md) | Cypress E2E Tests |
74
| [Selenium with Python (pytest)](references/selenium-with-python-pytest.md) | Selenium with Python (pytest) |
75
| [Page Object Model Pattern](references/page-object-model-pattern.md) | Page Object Model Pattern |
76
77
## Best Practices
78
79
### ✅ DO
80
81
- Use data-testid attributes for stable selectors
82
- Implement Page Object Model for maintainability
83
- Test critical user journeys thoroughly
84
- Run tests in multiple browsers (cross-browser testing)
85
- Use explicit waits instead of sleep/timeouts
86
- Clean up test data after each test
87
- Take screenshots on failures
88
- Parallelize test execution where possible
89
90
### ❌ DON'T
91
92
- Use brittle CSS selectors (like nth-child)
93
- Test every possible UI combination (focus on critical paths)
94
- Share state between tests
95
- Use fixed delays (sleep/timeout)
96
- Ignore flaky tests
97
- Run E2E tests for unit-level testing
98
- Test third-party UI components in detail
99
- Skip mobile/responsive testing
100

© AJ Geddes · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 14,621 prompts

More by @OpenSourceBuffGuy

See all
Sea turtle carrying floating film studio island prompt image

Sea turtle carrying floating film studio island

Draws a giant sea turtle carrying a floating island film studio through a starry sky, where fairies polish rough film strips into golden film.

image-prompt, nano-banana, 3d-render, cartoon, fantasy-world, creatures, animals, whimsical, dreamy, cinematic, dramatic-lighting, vibrant-colors, bokeh, miniature, widescreen, night-scene, illustration, concept-art, surreal, storytelling, clay-3d

Desert buggy escapes drones past industrial outpost prompt image

Desert buggy escapes drones past industrial outpost

Builds a 15-second desert chase video where a racer in an armored buggy escapes drones past an industrial outpost, using five reference images with set jobs.

video-prompt, hailuo, action, multi-shot, timed-beats, camera-movement, reference-image, character-consistency, negative-prompt, cinematic, sci-fi, cars, landscape, aerial-view, tracking-shot, photorealistic, sound-effects, structured-output, long-form, widescreen

1 view
Cozy Pixel Art Farm Island Village prompt image

Cozy Pixel Art Farm Island Village

Draws a cozy 16-bit pixel-art farming village across six small islands joined by bridges, with exact counts for buildings, animals and crops.

image-prompt, gpt-image, pixel-art, isometric, game-assets, concept-art, maps, worldbuilding, cozy, vibrant-colors, ocean, landscape, wide-shot, widescreen, game-development, video-games, structured-output, whimsical, summer, high-angle, aerial-view, animals, negative-prompt, cityscape

1 view

Reviews

Loading reviews…

Discussion

Loading comments…