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

export default defineConfig({
  testDir: './tests/e2e',
  testIgnore: [
    '**/external-user-flow.spec.ts',
    '**/external-roles-onboarding-dashboard.spec.ts',
    '**/external-role-screenshots.spec.ts',
    '**/storybook-admin-pages.spec.ts',
    '**/accessibility.spec.ts',
    '**/admin-visual.spec.ts',
    '**/visual/**',
    '**/management-parity.spec.ts',
  ],
  fullyParallel: true,
  reporter: [['list']],
  webServer: {
    command: 'npm run dev -- --port 3102 --host 127.0.0.1',
    url: 'http://127.0.0.1:3102/',
    reuseExistingServer: true,
    timeout: 300_000,
  },
  use: {
    baseURL: 'http://127.0.0.1:3102',
    trace: 'on-first-retry',
    screenshot: 'only-on-failure',
    viewport: { width: 1440, height: 900 },
  },
  projects: [
    {
      name: 'chromium',
      use: { ...devices['Desktop Chrome'] },
    },
  ],
});
