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

// INFRA-F67 — docs-site viewport overflow sweep. Reuses the same Vue docs
// dev server as playwright.config.ts (single project, no react-pilot harness
// needed — this only inspects the docs shell's own layout).
export default defineConfig({
  testDir: 'tests/docs-overflow',
  testMatch: '**/*.spec.ts',
  use: { baseURL: 'http://localhost:5173' },
  projects: [{ name: 'chromium', use: { ...devices['Desktop Chrome'] } }],
  webServer: {
    command: 'pnpm dev',
    url: 'http://localhost:5173',
    reuseExistingServer: true,
    timeout: 120_000,
  },
  // The single sweep test walks ~60 navigations (31 pages × 2 viewports), each
  // in its own fresh browser context (see the spec's rationale — bounds peak
  // Chromium resource usage so a GH runner doesn't hit ERR_INSUFFICIENT_RESOURCES
  // partway through). Fresh contexts are slower than reusing one page, so the
  // per-test budget is generous enough for a slow CI runner.
  timeout: 300_000,
})
