Orquesta Agentes IA que desarrollan por ti
Verificando...
37-e2e-tests-health
Procedimiento: E2E Tests Health Check
Calidad de Codigo
1 plugin(s)
Editor
Preview
Tareas
1
Info
Titulo
Evalúa la salud de los tests end-to-end. Verifica estabilidad, tiempos de ejecución, y cobertura de flujos críticos de usuario.
Descripcion
Contenido Markdown
9299 caracteres
Guardar
# Procedimiento: E2E Tests Health Check ## Metadata - **ID**: PROC-37 - **Frecuencia**: Semanal o Post-deploy - **Duraci├│n estimada**: 30-60 min (depende de suite) - **Requiere**: Entorno de staging, suite E2E configurada - **Dependencias**: Deploy en staging completado - **Bloquea**: Deploy a producci├│n (si fallan cr├¡ticos) - **Agentes**: qa-engineer --- ## Objetivo Verificar la salud de los tests End-to-End: 1. Ejecutar suite E2E completa 2. Analizar fallos y su causa 3. Verificar cobertura de flujos cr├¡ticos 4. Medir rendimiento de ejecuci├│n --- ## Herramientas Soportadas | Herramienta | Lenguaje | Uso | |-------------|----------|-----| | Playwright | Multi | Navegador | | Selenium | Multi | Navegador | | Cypress | JavaScript | Navegador | | Postman/Newman | API | API tests | | k6 | JavaScript | Performance | --- ## Umbrales | M├®trica | Objetivo | Warning | Fallo | |---------|----------|---------|-------| | Pass rate | >95% | 90-95% | <90% | | Tests cr├¡ticos | 100% | 95% | <95% | | Tiempo total | <30 min | 30-60 min | >60 min | | Flaky rate | <5% | 5-10% | >10% | --- ## Checklist Ejecutable ### 1. Preparar Entorno ```bash # Verificar que staging est├í disponible curl -s "$STAGING_URL/health" | grep -q "healthy" # Verificar credenciales de test echo "TEST_USER=$TEST_USER" echo "API configured: $(test -n "$API_KEY" && echo "yes" || echo "no")" ``` - [ ] Staging disponible - [ ] Credenciales configuradas ### 2. Ejecutar Suite E2E #### Playwright ```bash # Ejecutar todos los tests npx playwright test --reporter=json,html # Solo tests cr├¡ticos npx playwright test --grep "@critical" # Con reintentos para flaky npx playwright test --retries=2 # Guardar resultados npx playwright test --reporter=json --output=results/ ``` #### Cypress ```bash # Ejecutar suite npx cypress run --reporter json --reporter-options "output=results/cypress.json" # Con video para debug npx cypress run --record ``` #### Newman (Postman) ```bash # Ejecutar colecci├│n newman run collection.json \ --environment staging.json \ --reporters cli,json \ --reporter-json-export results/newman.json ``` - [ ] Suite ejecutada - [ ] Resultados guardados ### 3. Analizar Resultados ```bash # Playwright - Parsear resultados cat results/results.json | jq '{ total: .suites | [.. | .specs[]?] | length, passed: [.. | .tests[]? | select(.status == "passed")] | length, failed: [.. | .tests[]? | select(.status == "failed")] | length, skipped: [.. | .tests[]? | select(.status == "skipped")] | length, duration: .stats.duration }' # Newman cat results/newman.json | jq '{ total: .run.stats.tests.total, passed: .run.stats.tests.pending + .run.stats.assertions.pending, failed: .run.stats.assertions.failed }' ``` **Resumen de ejecuci├│n:** | M├®trica | Valor | |---------|-------| | Total tests | ___ | | Pasados | ___ | | Fallidos | ___ | | Skipped | ___ | | Duraci├│n | ___ min | | Pass rate | ___% | - [ ] Resultados analizados ### 4. Categorizar Tests Fallidos ```bash # Extraer tests fallidos con detalles cat results/results.json | jq ' [.. | .tests[]? | select(.status == "failed")] | .[] | { name: .title, file: .location.file, error: .errors[0].message }' ``` **Clasificaci├│n de fallos:** | Tipo | Descripci├│n | Acci├│n | |------|-------------|--------| | Bug real | Fallo en la aplicaci├│n | Crear issue | | Test flaky | Falla intermitente | Revisar test | | Entorno | Problema de staging | Revisar infra | | Datos | Datos de test inv├ílidos | Actualizar fixtures | | Timeout | Lentitud | Optimizar o aumentar | | Test | Error | Tipo | Acci├│n | |------|-------|------|--------| | ___ | ___ | ___ | ___ | - [ ] Fallos categorizados ### 5. Verificar Cobertura de Flujos Cr├¡ticos **Flujos cr├¡ticos t├¡picos:** | Flujo | Test Existe | Pasa | |-------|-------------|------| | Login/Logout | Ô£à/ÔØî | Ô£à/ÔØî | | Registro usuario | Ô£à/ÔØî | Ô£à/ÔØî | | Crear orden/pedido | Ô£à/ÔØî | Ô£à/ÔØî | | Proceso de pago | Ô£à/ÔØî | Ô£à/ÔØî | | B├║squeda principal | Ô£à/ÔØî | Ô£à/ÔØî | | Flujo admin | Ô£à/ÔØî | Ô£à/ÔØî | ```bash # Verificar que tests cr├¡ticos existen grep -r "@critical\|describe.*[Cc]ritical" tests/e2e --include="*.ts" --include="*.js" ``` - [ ] Flujos cr├¡ticos cubiertos - [ ] Todos los cr├¡ticos pasan ### 6. Analizar Rendimiento ```bash # Tests m├ís lentos cat results/results.json | jq ' [.. | .tests[]? | select(.status == "passed")] | sort_by(-.duration) | .[0:10] | .[] | {name: .title, duration_ms: .duration}' ``` **Top 10 tests lentos:** | Test | Duraci├│n | ┬┐Optimizable? | |------|----------|---------------| | ___ | ___ ms | S├¡/No | - [ ] Tests lentos identificados ### 7. Comparar con Ejecuci├│n Anterior ```bash # Si guardas historial diff <(cat results/previous.json | jq '.passed') \ <(cat results/current.json | jq '.passed') # Nuevos fallos comm -13 <(cat previous_failures.txt | sort) <(cat current_failures.txt | sort) # Tests arreglados comm -23 <(cat previous_failures.txt | sort) <(cat current_failures.txt | sort) ``` - [ ] Regresiones identificadas - [ ] Mejoras documentadas ### 8. Tomar Acciones **Por cada test fallido:** ```markdown ## Fallo: [Nombre del test] ### Error [Mensaje de error] ### Screenshot/Video [Link a evidencia] ### Clasificaci├│n - [ ] Bug real ÔåÆ Crear issue - [ ] Test flaky ÔåÆ Fix en tests - [ ] Datos ÔåÆ Actualizar fixtures - [ ] Entorno ÔåÆ Escalar a DevOps ### Issue creado [Link a issue si aplica] ``` - [ ] Issues creados para bugs reales - [ ] Fixes planificados para tests --- ## Output Esperado ``` ====== PROC-37 COMPLETADO [TIMESTAMP] ====== Proyecto: [nombre] Entorno: Staging URL: [staging_url] RESUMEN EJECUCI├ôN: - Total tests: X - Pasados: Y (Z%) - Fallidos: W - Skipped: V - Duraci├│n: T min ESTADO: Ô£à SALUDABLE / ÔÜá´©Å DEGRADADO / ÔØî CR├ìTICO TESTS FALLIDOS: | Test | Error | Tipo | Acci├│n | |------|-------|------|--------| | LoginTest | Timeout | Entorno | Reintentar | | CheckoutFlow | Element not found | Bug | ISSUE-123 | FLUJOS CR├ìTICOS: - Login: Ô£à - Checkout: ÔØî (ISSUE-123) - Search: Ô£à - Admin: Ô£à TESTS LENTOS (>30s): | Test | Duraci├│n | |------|----------| | FullOrderFlow | 45s | COMPARACI├ôN: - Nuevos fallos: X - Tests arreglados: Y - Regresi├│n: S├¡/No ACCIONES: 1. [ISSUE-123] Fix checkout button 2. Revisar timeout en LoginTest 3. Optimizar FullOrderFlow RECOMENDACI├ôN DEPLOY: Ô£à Proceder / ÔØî Bloquear (tests cr├¡ticos fallando) ``` --- ## Criterios de ├ëxito - [ ] Pass rate > 95% - [ ] Flujos cr├¡ticos 100% - [ ] Sin nuevas regresiones - [ ] Duraci├│n < 30 min --- ## Alertas y Escalaci├│n | Severidad | Condici├│n | Acci├│n | |-----------|-----------|--------| | CRITICAL | Flujo cr├¡tico falla | Bloquear deploy | | CRITICAL | Pass rate < 80% | Investigar inmediatamente | | WARNING | Pass rate < 95% | Revisar fallos | | INFO | Todo OK | Proceder con deploy | --- ## Automatizaci├│n En ejecuci├│n no-interactiva: 1. Ejecutar suite E2E 2. Parsear resultados 3. Clasificar fallos 4. Verificar cr├¡ticos 5. Generar reporte 6. Alertar si hay cr├¡ticos fallando --- ## Configuraci├│n CI/CD ```yaml # GitLab CI e2e: stage: test script: - npx playwright test artifacts: when: always paths: - playwright-report/ reports: junit: results.xml rules: - if: $CI_PIPELINE_SOURCE == "schedule" - if: $CI_COMMIT_BRANCH == "main" ``` --- --- ## Output Estructurado (Nexus) Al finalizar, el agente DEBE generar un bloque JSON con el siguiente formato para que Nexus pueda procesarlo automaticamente: ```json { "result": "success", "summary": "Ejecucion de PROC-37 completada. [Descripcion breve de resultados]", "metrics": { "issues_found": 0, "issues_resolved": 0, "tests_passed": 100, "tests_failed": 0, "coverage_percent": 78, "custom": { "procedure_specific_metric": "value" } }, "backlog_items": [ { "title": "Titulo del item de seguimiento", "description": "Descripcion detallada si se requiere accion futura", "priority": "medium", "type": "improvement", "tags": ["proc-37"] } ], "next_steps": [ "Accion recomendada 1", "Accion recomendada 2" ], "warnings": [ "Advertencias encontradas durante la ejecucion" ] } ``` **Campos requeridos:** - `result`: `"success"` | `"partial"` | `"failed"` - `summary`: Resumen ejecutivo en 1-3 lineas **Metricas especificas de este procedure:** - e2e_total, e2e_passed, e2e_failed, duration_min **Criterios de resultado:** - `success`: Procedimiento completado sin errores criticos - `partial`: Completado con algunos problemas menores o items pendientes - `failed`: Error critico o no se pudo completar ## Historial de Ejecuciones | Fecha | Proyecto | Total | Pasados | Fallidos | Cr├¡ticos OK | Deploy | |-------|----------|-------|---------|----------|-------------|--------| | | | | | | | |
H1
H2
H3
Bold
Italic
Code
Lista
Num
Task
Code Block
Link
Nexus Platform
Reconectando
Recuperando la conexion
Se ha interrumpido la conexion con el servidor. Estamos reconectando automaticamente.
Reconectando...
Manten esta pestana abierta, volvemos enseguida.
No hemos podido reconectar
El servidor puede estar reiniciandose o tu conexion a internet es inestable.
Reintentar
La sesion ha expirado
Recarga la pagina para iniciar una nueva sesion.
Recargar
Si no vuelve en 30 segundos, recarga la pagina.