'use strict'; // Playwright UI tests (#45 phase 5). They expect a running Pulse stack with three // workers: scripts/ci/ui-stack.sh starts one. Files are *.ui.js so jest skips them. const { defineConfig, devices } = require('@playwright/test'); const CI = !!process.env.CI; module.exports = defineConfig({ testDir: 'tests/ui', testMatch: '**/*.ui.js', // One shared database and real workers: run serially so tests can't race each other. workers: 1, fullyParallel: false, forbidOnly: CI, retries: CI ? 1 : 0, timeout: 30_000, expect: { timeout: 10_000 }, reporter: CI ? [['list'], ['html', { open: 'never' }]] : 'list', use: { baseURL: process.env.PULSE_UI_URL || 'http://127.0.0.1:8400', trace: 'retain-on-failure', screenshot: 'only-on-failure', }, projects: [ { name: 'desktop', use: { ...devices['Desktop Chrome'], viewport: { width: 1440, height: 900 } } }, { name: 'mobile', use: { ...devices['Pixel 7'] }, testMatch: '**/responsive.ui.js' }, ], });