test-automation-framework by aj-geddes/useful-ai-prompts
npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill test-automation-framework测试自动化框架为自动化测试提供了结构、可重用性和可维护性。它定义了组织测试、管理测试数据、处理依赖关系和生成报告的规范模式。一个设计良好的框架可以减少重复工作、提高可靠性并加速测试开发。
最小工作示例:
// 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(),
]);
}
}
// ... (完整实现请参阅参考指南)
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
references/ 目录中的详细实现:
| 指南 | 内容 |
|---|---|
| 页面对象模型 (Playwright/TypeScript) | 页面对象模型 (Playwright/TypeScript) |
| 测试夹具和工厂 | 测试夹具和工厂 |
| 自定义测试工具 | 自定义测试工具 |
| 配置管理 | 配置管理 |
| 自定义报告器 | 自定义报告器 |
| pytest 框架 (Python) | pytest 框架 (Python) |
| 测试组织 | 测试组织 |
每周安装量
126
代码仓库
GitHub 星标数
121
首次出现
Jan 21, 2026
安全审计
安装于
opencode107
gemini-cli102
codex100
cursor98
claude-code93
github-copilot83
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.
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)
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 |
Weekly Installs
126
Repository
GitHub Stars
121
First Seen
Jan 21, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode107
gemini-cli102
codex100
cursor98
claude-code93
github-copilot83
通过 LiteLLM 代理让 Claude Code 对接 GitHub Copilot 运行 | 高级变通方案指南
33,600 周安装
rpi:完整的RPI生命周期编排器,自动化软件开发生命周期管理工具
317 周安装
TypeScript安全审查工具 - OWASP Top 10代码审计与Node.js应用安全评估
150 周安装
高级安全运维工具包 | 自动化安全扫描、漏洞评估、合规性检查 | 企业级SecOps解决方案
315 周安装
API设计模式指南:REST/GraphQL/tRPC决策、版本控制与安全最佳实践
315 周安装
SQLAlchemy Alembic 专家最佳实践与代码审查指南 - 生产级数据库迁移优化
322 周安装
AI会话交接技能:无缝延续工作流,创建结构化交接文档和提示
321 周安装
| Test Organization |