test-automation-framework — Claude Code skill: test framework setup
A skill for designing a test automation framework: Page Object Model, fixtures, reporting and test organization. Useful once a suite grows and needs a shared shape.
npx skills add aj-geddes/useful-ai-prompts --skill test-automation-framework -a claude-codeWhat test-automation-framework does
The skill walks through building test automation structure: the Page Object Model, fixtures and test data factories, custom utilities, configuration management and a custom reporter. It opens with a short TypeScript example — a base page class for @playwright/test — and points to seven reference guides in the references/ directory: POM for Playwright and TypeScript, fixtures and factories, custom utilities, configuration, a custom reporter, a pytest framework for Python, and test organization.
There is also a do-and-don't list. Test logic stays out of page objects, hard-coded sleeps give way to wait strategies, test data is kept apart from test logic, and environment URLs are not hardcoded. Worth checking your existing suite against it — you will likely find a few of these.
The skill installs across six platforms, but the code samples and directory layout assume Playwright with TypeScript or pytest. On another stack you port the guides yourself.
What it helps with
- lay out a large test suite by feature and type
- move repeated page interactions into page objects
- build fixtures and factories for test data
- configure several environments without hardcoded URLs
- add a readable report for test runs
Example prompts for the agent
- help me design a Playwright test framework with the Page Object Model
- organize my tests by feature and type and cut the duplicated setup
- create fixtures and factories for test data instead of copy-paste
How to install test-automation-framework
1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill test-automation-framework -a claude-code2Manually: put the files in place
~/.claude/skills/test-automation-framework/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/test-automation-framework/
1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill test-automation-framework -a codex2Manually: put the files in place
.agents/skills/test-automation-framework/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill test-automation-framework -a cursor2Manually: put the files in place
.cursor/skills/test-automation-framework/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install aj-geddes/useful-ai-prompts test-automation-framework2Manually: put the files in place
.github/skills/test-automation-framework/SKILL.md1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill test-automation-framework -a gemini-cli2Platform CLI
gemini skills install https://github.com/aj-geddes/useful-ai-prompts --path skills/test-automation-frameworkManually: put the files in place
.devin/skills/test-automation-framework/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill test-automation-framework -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about test-automation-framework
How do I install test-automation-framework in Claude?
Run npx skills add aj-geddes/useful-ai-prompts --skill test-automation-framework -a claude-code. The skill file then lands at ~/.claude/skills/test-automation-framework/SKILL.md.
What does test-automation-framework do?
It helps you design and assemble a test automation framework: Page Object Model, fixtures and data factories, utilities, configuration and reporting. It also lists practices to avoid in a suite.
Which stack do the examples use?
The starting example is TypeScript for @playwright/test, and one guide covers pytest in Python. Other platforms are supported, but the guides do not break the code down for them.
Source text
SKILL.md · MIT
---
name: test-automation-framework
description: >
Design and implement scalable test automation frameworks with Page Object
Model, fixtures, and reporting. Use for test framework, page object pattern,
test architecture, test organization, and automation infrastructure.
---
# Test Automation Framework
## Table of Contents
- [Overview](#overview)
- [When to Use](#when-to-use)
- [Quick Start](#quick-start)
- [Reference Guides](#reference-guides)
- [Best Practices](#best-practices)
## Overview
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.
## When to Use
- Setting up new test automation
- Scaling existing test suites
- Standardizing test practices across teams
- Reducing test maintenance burden
- Improving test reliability and speed
- Organizing large test codebases
- Implementing reusable test utilities
- Creating consistent reporting
## Quick Start
Minimal working example:
```typescript
// framework/pages/BasePage.ts
import { Page, Locator } from "@playwright/test";
export abstract class BasePage {
constructor(protected page: Page) {}
async goto(path: string) {
await this.page.goto(path);
}
async waitForPageLoad() {
await this.page.waitForLoadState("networkidle");
}
async takeScreenshot(name: string) {
await this.page.screenshot({ path: `screenshots/${name}.png` });
}
protected async clickAndWait(locator: Locator) {
await Promise.all([
this.page.waitForResponse((resp) => resp.status() === 200),
locator.click(),
]);
}
}
// ... (see reference guides for full implementation)
```
## Reference Guides
Detailed implementations in the `references/` directory:
| Guide | Contents |
|---|---|
| [Page Object Model (Playwright/TypeScript)](references/page-object-model-playwrighttypescript.md) | Page Object Model (Playwright/TypeScript) |
| [Test Fixtures and Factories](references/test-fixtures-and-factories.md) | Test Fixtures and Factories |
| [Custom Test Utilities](references/custom-test-utilities.md) | Custom Test Utilities |
| [Configuration Management](references/configuration-management.md) | Configuration Management |
| [Custom Reporter](references/custom-reporter.md) | Custom Reporter |
| [pytest Framework (Python)](references/pytest-framework-python.md) | pytest Framework (Python) |
| [Test Organization](references/test-organization.md) | Test Organization |
## Best Practices
### ✅ DO
- Use Page Object Model for UI tests
- Create reusable test utilities
- Implement proper wait strategies
- Use fixtures for test data
- Configure for multiple environments
- Generate readable test reports
- Organize tests by feature/type
- Version control test framework
### ❌ DON'T
- Put test logic in page objects
- Use hard-coded waits (sleep)
- Duplicate test setup code
- Mix test data with test logic
- Skip error handling
- Ignore test flakiness
- Create overly complex abstractions
- Hardcode environment URLs
© aj-geddes · MIT · aj-geddes/useful-ai-prompts