自动化测试框架

一个支持多种测试策略的自动化测试框架,包括AI驱动的探索性测试和优化的回归测试。

  • by gmartcas
  • JavaScript
  • 本地部署
  • 更新于
在 GitHub 查看 gmartcas/playwright-mcp-orange-demo

使用说明

剧作家MCP橙色演示

具有多种执行策略的自动化测试框架:从IA的探索性测试到优化的回归测试。

🎯 这是什么?

一个框架,允许您根据需要以不同的方式运行测试:

  • 🤖 AI 代理:在不编写代码的情况下从自然语言运行测试
  • 🥒 黄瓜:使用0个令牌消费的可重复使用的BDD测试
  • ⚡ 剧作家:高性能综合测试
  • 📝 手册:控制总输入

🚀 快速启动

# Explorar con IA (sin código)
npm run ai:test "Ve a orange.es y valida que aparece el logo"

# Ejecutar tests Cucumber (recomendado)
npm run test:cucumber

# Ejecutar tests Playwright consolidados
npm run test:smoke

📖 查看完整指南 | 实用实例


⚙️ 安装

# Clonar repositorio
git clone https://github.com/gmartcas/playwright-mcp-orange-demo.git
cd playwright-mcp-orange-demo

# Instalar dependencias
npm install

# Instalar navegadores
npx playwright install

配置环境变量

创建新文件 .env 在根上:

ANTHROPIC_API_KEY=tu_api_key_aqui

📁 项目结构

playwright-mcp-orange-demo/
├── features/               # Tests Cucumber (.feature + step definitions)
├── tests/                  # Tests organizados por tipo
│   ├── playwright/        # Tests Playwright consolidados (versionados)
│   │   ├── smoke/        # Tests críticos < 5 min
│   │   ├── e2e/          # Tests E2E < 30 min
│   │   └── integration/  # Tests integración < 15 min
│   ├── exploratory/       # Tests exploratorios (no versionar)
│   └── requests/          # Instrucciones para AI Agent
├── src/                   # Código fuente (Clean Architecture)
│   ├── domain/           # Entidades y lógica de negocio
│   ├── application/      # Casos de uso
│   ├── infrastructure/   # Adaptadores externos
│   └── interface/        # CLI y controladores
└── docs/                  # Documentación organizada
    ├── architecture/     # Diseño técnico y diagramas
    ├── guides/          # Guías prácticas de usuario
    └── technical/       # Documentación técnica detallada

🎯 主要脚本

日常发展

# Exploración con Cucumber (0 tokens)
npm run test:explore
npm run test:explore:headed    # Con navegador visible
npm run test:explore:watch     # Modo watch

人工智能发电

# Generar solo .feature desde lenguaje natural
npm run generate:feature "descripción del test" @smoke

# Generar .feature + .spec.ts completo (⭐ Recomendado)
npm run generate:full "descripción del test" smoke @smoke

黄瓜测试(Estrategia校长)

npm run test:cucumber              # Todos los tests
npm run test:cucumber:smoke        # Solo @smoke
npm run test:cucumber:e2e          # Solo @e2e
npm run test:cucumber:integration  # Solo @integration
npm run test:cucumber:xray         # Con reporte para Xray

Playwright 综合测试

npm run test:smoke         # Tests críticos
npm run test:e2e          # Tests E2E completos
npm run test:integration  # Tests de integración
npm run test:suite        # Todos los suites

人工智能代理(快速扫描)

npm run ai:test "instrucción en lenguaje natural"
npm run ai:file tests/requests/mi-instruccion.txt
npm run ai:batch tests/requests/

巩固(功能→规格)

npm run consolidate features/regression/login.feature
npm run consolidate:to-suite features/regression/login.feature smoke

公用事业

npm run report            # Ver último reporte HTML
npm run lint              # Linter

📚 完整的文件

🏗️ 建筑

📘 用户指南

🔧 技术文件

👉 查看完整索引


🔧 配置

剧作家(playwright.config.ts)

  • 按测试类型划分的超时
  • HTML和JSON报告
  • IC中的自动重试

黄瓜(cucumber.config.js)

  • 标签:@smoke,@e2e,@integration
  • 可重复使用的步骤定义
  • 多种报告格式

🤝 争议

  1. 叉库
  2. 创建分支 : git checkout -b feature/nueva-funcionalidad
  3. 承诺: git commit -m "feat: descripción"
  4. 推: git push origin feature/nueva-funcionalidad
  5. 打开拉动请求

📝 许可证

麻省理工学院


🔗 有用的链接


第一次? → 快速引导
杜达斯? → 完整的文件
麻烦? → 问题