import { defineConfig, devices } from "@playwright/test"; /** * Configuración de pruebas de extremo a extremo. * * WebKit está incluido a propósito y no es opcional: es el motor de Safari e iOS, * donde más se rompe la responsividad, y el cliente lo pidió explícitamente. * Una prueba que solo pasa en Chromium no prueba responsividad. */ const PUERTO = 3100; const BASE = `http://127.0.0.1:${PUERTO}`; export default defineConfig({ testDir: "./tests", fullyParallel: true, forbidOnly: true, retries: 1, workers: 3, timeout: 45_000, expect: { timeout: 8_000 }, reporter: [ ["list"], ["json", { outputFile: "tests/reporte/resultado.json" }], ["html", { outputFolder: "tests/reporte/html", open: "never" }], ], use: { baseURL: BASE, locale: "es-MX", timezoneId: "America/Mexico_City", trace: "retain-on-failure", screenshot: "only-on-failure", video: "off", }, projects: [ { name: "escritorio-chromium", use: { ...devices["Desktop Chrome"], viewport: { width: 1440, height: 900 } }, }, { name: "escritorio-webkit", use: { ...devices["Desktop Safari"], viewport: { width: 1440, height: 900 } }, }, { name: "movil-webkit", use: { ...devices["iPhone 13"] }, }, { name: "movil-chico", use: { ...devices["Desktop Chrome"], viewport: { width: 320, height: 640 }, isMobile: false }, }, ], webServer: { command: `npm run start -- --port ${PUERTO}`, url: `${BASE}/api/salud`, reuseExistingServer: true, timeout: 180_000, stdout: "pipe", stderr: "pipe", }, });