Test automation framework

From aj-geddes/useful-ai-prompts · View interactive version

Test automation framework is an AI agent skill from the GitHub repository aj-geddes/useful-ai-prompts. 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.

How to use this skill

Skill file

Test Automation Framework

Table of Contents

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

Quick Start

Minimal working example:

// 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) | Page Object Model (Playwright/TypeScript) |

| Test Fixtures and Factories | Test Fixtures and Factories |

| Custom Test Utilities | Custom Test Utilities |

| Configuration Management | Configuration Management |

| Custom Reporter | Custom Reporter |

| pytest Framework (Python) | pytest Framework (Python) |

| Test Organization | Test Organization |

Best Practices

✅ DO

❌ DON'T

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.