IP

idavidov13/playwright-scaffold-ai-assisted-development-public

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

72 stars 质量 58 趋势 18

剧作家支架公共仓库——AI辅助测试自动化

概览

一个基于TypeScript构建的生产准备版Playwright测试自动化支架。从零开始设计——只需描述你需要什么,AI编码助手会自动生成符合框架惯例的测试、页面对象和模式。 克隆它,指向你的应用,然后立即开始构建测试套件。示例文件展示了每个模式,这样你(和你的AI助手)总有参考。 大多数Playwright项目都是从零开始,随着时间推移会积累不一致之处——混合选择策略、缺乏数据隔离、零散的辅助工具,以及AI工具无法可靠追踪的模式。 这个支架解决了这个问题。它为你提供了严格的约定、类型安全和模块化的AI规则系统,无论你用的是Claude Code、Cursor还是GitHub Copilot,都能保持生成代码的一致性。

概述(AI 翻译)

一个基于TypeScript构建的生产准备版Playwright测试自动化支架。从零开始为AI辅助测试开发设计——只需描述你需要什么,AI编码助手会自动生成符合框架惯例的测试、页面对象和模式。

这是一个支架,不是库。 克隆它,指向你的应用,立即开始构建测试套件。示例文件展示了每个模式,这样你(和你的 AI 助手)总有参考。


为什么要用这个脚手架?

大多数Playwright项目都是从零开始,随着时间推移会积累不一致之处——混合选择策略、缺乏数据隔离、零散的辅助工具,以及AI工具无法可靠追踪的模式。

这个支架解决了这个问题。它为你提供了一个完全架构化的起点,有严格的约定、类型安全,以及一个模块化的AI规则系统,无论你用的是Claude Code、Cursor还是GitHub Copilot,都能保持生成代码的一致性。


包含内容

框架架构

  • 基于夹具的依赖注入页面对象模型——测试中无需手动实例化

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Playwright Scaffold — AI-Assisted Test Automation

A production-ready Playwright test automation scaffold built with TypeScript. Designed from the ground up for AI-assisted test development — just describe what you need, and your AI coding assistant generates tests, page objects, and schemas that follow the framework’s conventions automatically.

This is a scaffold, not a library. Clone it, point it at your app, and start building your test suite immediately. Example files demonstrate every pattern so you (and your AI assistant) always have a reference.


Why This Scaffold?

Most Playwright projects start from scratch and accumulate inconsistencies over time — mixed selector strategies, no data isolation, scattered helpers, and patterns that AI tools can’t follow reliably.

This scaffold solves that. It gives you a fully architected starting point with strict conventions, type safety, and a modular AI rules system that keeps generated code consistent whether you’re using Claude Code, Cursor, or GitHub Copilot.


What’s Included

Framework Architecture

  • Page Object Model with fixture-based dependency injection — no manual instantiation in tests
  • API testing fixture (apiRequest) with generic type support and Zod schema validation
  • Helper fixtures for reusable setup/teardown lifecycle management
  • Component composition pattern for shared UI elements across pages
  • Layered fixture merging — POM, API, and helper fixtures combined into a single import point

Type Safety & Validation

  • TypeScript strict mode throughout
  • Zod schemas (strictObject) for runtime API response validation
  • Typed factories (Faker + Zod) for dynamic test data generation
  • No any allowed — enforced by ESLint rules

Test Organization

  • Tag-based execution — @smoke, @sanity, @regression, @api, @e2e, @destructive
  • Given/When/Then step structure with test.step() for readable reports
  • Data-driven tests with static JSON for boundary cases and Faker factories for happy paths
  • Destructive test isolation — tests that modify shared state run sequentially with mandatory cleanup hooks
  • Multi-browser support — Chromium, Firefox, WebKit configurations ready to go

AI Rules System

  • Modular orchestrator + skills architecture — always-loaded orchestrator with on-demand detailed skills
  • 14 specialized skill files covering selectors, page objects, fixtures, test standards, API testing, data strategy, type safety, enums, configuration, helpers, common tasks, refactoring, and browser-based page exploration
  • ai-native-workflow meta skill — the operating manual that ties every other skill together: the conversation contract, the 7-phase task lifecycle, and the five principles that keep AI-generated output consistent (see How You Work With the AI Agent)
在 GitHub 查看完整 README

推荐工具

换一个关键词,或者移除筛选条件。

安装

npx skillfish add idavidov13/playwright-scaffold-ai-assisted-development-public
新手?先看 mcpskill.org 教程 →