import { defineConfig, devices } from '@playwright/test';

/**
 * Playwright configuration for MCP Gateway Registry e2e tests.
 *
 * The app is served by nginx on port 80 (http://localhost).
 * Authentication uses basic auth with session cookies.
 */
export default defineConfig({
  testDir: './e2e',
  fullyParallel: false,
  forbidOnly: !!process.env.CI,
  retries: process.env.CI ? 2 : 0,
  workers: 1,
  reporter: 'html',
  timeout: 60_000,

  use: {
    baseURL: 'http://localhost',
    trace: 'on-first-retry',
    screenshot: 'only-on-failure',
    video: 'retain-on-failure',
  },

  projects: [
    {
      name: 'chromium',
      use: { ...devices['Desktop Chrome'] },
    },
  ],
});
