test-automation-framework — скилл для Claude Code: каркас автотестов
Скилл помогает спроектировать каркас автотестов: Page Object Model, фикстуры, отчёты и организация тестов. Пригодится, когда тестовый набор растёт и его пора приводить к общему виду.
npx skills add aj-geddes/useful-ai-prompts --skill test-automation-framework -a claude-codeЧто делает test-automation-framework
Скилл описывает, как устроить автоматизацию тестов: паттерн Page Object Model, фикстуры и фабрики тестовых данных, вспомогательные утилиты, управление конфигурацией и свой репортёр. Внутри — краткий стартовый пример на TypeScript с базовым классом страницы для @playwright/test и семь справочных руководств в каталоге references/: POM для Playwright и TypeScript, фикстуры и фабрики, кастомные утилиты, конфигурация, свой репортёр, каркас на pytest для Python и организация тестов.
Отдельный блок — правила «делай и не делай». Логику тестов не кладут в page objects, вместо жёстких пауз используют стратегии ожидания, тестовые данные не смешивают с логикой, а URL окружений не хардкодят. Это повод проверить свои существующие тесты: часть замечаний почти наверняка найдётся.
Скилл ставится в шесть платформ, но примеры кода и структура каталогов ориентированы на Playwright с TypeScript и на pytest. Если ваш стек другой, руководства придётся переносить самому.
Какие задачи решает
- разложить большой тестовый набор по фичам и типам
- вынести повторяющиеся действия со страницей в page objects
- сделать фикстуры и фабрики для тестовых данных
- настроить конфигурацию под несколько окружений без хардкода URL
- подключить читаемый отчёт о прогоне тестов
Примеры запросов агенту
- помоги спроектировать каркас автотестов на Playwright с Page Object Model
- разложи мои тесты по фичам и типам и убери дублирование в setup
- сделай фикстуры и фабрики для тестовых данных вместо копипасты
Как установить test-automation-framework
1Через Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill test-automation-framework -a claude-code2Вручную: положить файлы
~/.claude/skills/test-automation-framework/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/test-automation-framework/
1Через Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill test-automation-framework -a codex2Вручную: положить файлы
.agents/skills/test-automation-framework/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill test-automation-framework -a cursor2Вручную: положить файлы
.cursor/skills/test-automation-framework/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install aj-geddes/useful-ai-prompts test-automation-framework2Вручную: положить файлы
.github/skills/test-automation-framework/SKILL.md1Через Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill test-automation-framework -a gemini-cli2Командой платформы
gemini skills install https://github.com/aj-geddes/useful-ai-prompts --path skills/test-automation-frameworkВручную: положить файлы
.devin/skills/test-automation-framework/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill test-automation-framework -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о test-automation-framework
Как установить test-automation-framework в Claude?
Выполните npx skills add aj-geddes/useful-ai-prompts --skill test-automation-framework -a claude-code. После этого файл скилла окажется по пути ~/.claude/skills/test-automation-framework/SKILL.md.
Что делает test-automation-framework?
Помогает спроектировать и собрать каркас автотестов: Page Object Model, фикстуры и фабрики данных, утилиты, конфигурацию и отчёты. Плюс даёт список практик, чего в тестах избегать.
На каком стеке примеры в скилле?
Стартовый пример написан на TypeScript для @playwright/test, отдельное руководство посвящено pytest на Python. Остальные платформы скилл поддерживает, но код в руководствах под них не разложен.
Исходный текст
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