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

// Keyboard-a11y e2e for the canonical Select (INFRA-F68 a11y-03, WCAG 2.1.1
// Level A). Separate from playwright.a11y.config.ts (axe scans) because this
// suite drives real keyboard interaction against an isolated harness route
// (/internal/select-keyboard-harness) rather than auditing docs pages.
//
// Shares the same dev server (port 5173) so it runs back-to-back with the other
// Playwright suites without a restart.

export default defineConfig({
  testDir: 'tests/select-keyboard',
  use: {
    baseURL: 'http://localhost:5173',
    viewport: { width: 1280, height: 900 },
  },
  projects: [
    {
      name: 'chromium',
      use: { ...devices['Desktop Chrome'] },
    },
  ],
  webServer: {
    command: 'pnpm dev',
    url: 'http://localhost:5173',
    reuseExistingServer: true,
    timeout: 120_000,
  },
  testMatch: '**/*.spec.ts',
  fullyParallel: false,
  workers: 1,
})
