Test Automation Framework

Test Automation Framework

Teaches an agent to design scalable test automation frameworks with Page Object Model, fixtures, utilities, configuration and custom reporting.

Skill files10 files

references/

scripts/

templates/

SKILL.md104 lines
1
---
2
name: test-automation-framework
3
description: >
4
Design and implement scalable test automation frameworks with Page Object
5
Model, fixtures, and reporting. Use for test framework, page object pattern,
6
test architecture, test organization, and automation infrastructure.
7
---
8
9
# Test Automation Framework
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
A test automation framework provides structure, reusability, and maintainability for automated tests. It defines patterns for organizing tests, managing test data, handling dependencies, and generating reports. A well-designed framework reduces duplication, improves reliability, and accelerates test development.
22
23
## When to Use
24
25
- Setting up new test automation
26
- Scaling existing test suites
27
- Standardizing test practices across teams
28
- Reducing test maintenance burden
29
- Improving test reliability and speed
30
- Organizing large test codebases
31
- Implementing reusable test utilities
32
- Creating consistent reporting
33
34
## Quick Start
35
36
Minimal working example:
37
38
```typescript
39
// framework/pages/BasePage.ts
40
import { Page, Locator } from "@playwright/test";
41
42
export abstract class BasePage {
43
constructor(protected page: Page) {}
44
45
async goto(path: string) {
46
await this.page.goto(path);
47
}
48
49
async waitForPageLoad() {
50
await this.page.waitForLoadState("networkidle");
51
}
52
53
async takeScreenshot(name: string) {
54
await this.page.screenshot({ path: `screenshots/${name}.png` });
55
}
56
57
protected async clickAndWait(locator: Locator) {
58
await Promise.all([
59
this.page.waitForResponse((resp) => resp.status() === 200),
60
locator.click(),
61
]);
62
}
63
}
64
// ... (see reference guides for full implementation)
65
```
66
67
## Reference Guides
68
69
Detailed implementations in the `references/` directory:
70
71
| Guide | Contents |
72
|---|---|
73
| [Page Object Model (Playwright/TypeScript)](references/page-object-model-playwrighttypescript.md) | Page Object Model (Playwright/TypeScript) |
74
| [Test Fixtures and Factories](references/test-fixtures-and-factories.md) | Test Fixtures and Factories |
75
| [Custom Test Utilities](references/custom-test-utilities.md) | Custom Test Utilities |
76
| [Configuration Management](references/configuration-management.md) | Configuration Management |
77
| [Custom Reporter](references/custom-reporter.md) | Custom Reporter |
78
| [pytest Framework (Python)](references/pytest-framework-python.md) | pytest Framework (Python) |
79
| [Test Organization](references/test-organization.md) | Test Organization |
80
81
## Best Practices
82
83
### ✅ DO
84
85
- Use Page Object Model for UI tests
86
- Create reusable test utilities
87
- Implement proper wait strategies
88
- Use fixtures for test data
89
- Configure for multiple environments
90
- Generate readable test reports
91
- Organize tests by feature/type
92
- Version control test framework
93
94
### ❌ DON'T
95
96
- Put test logic in page objects
97
- Use hard-coded waits (sleep)
98
- Duplicate test setup code
99
- Mix test data with test logic
100
- Skip error handling
101
- Ignore test flakiness
102
- Create overly complex abstractions
103
- Hardcode environment URLs
104

© 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…