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

/**
 * Playwright config for running the full E2E suite against
 * the deployed production site with direct database access.
 *
 * Requires: DATABASE_URL pointing to the production SQLite DB.
 *
 * Usage:
 *   DATABASE_URL="file:/var/lib/docker/volumes/llmhostscom_frontend_data/_data/llmhost.db" \
 *   npx playwright test --config=playwright.prod.config.ts
 */
export default defineConfig({
  testDir: './e2e',
  testIgnore: 'smoke-*.spec.ts',
  fullyParallel: false,
  retries: 0,
  workers: 1,
  reporter: [['list']],
  timeout: 60000,

  use: {
    baseURL: process.env.E2E_BASE_URL || 'https://llmhosts.com',
    trace: 'retain-on-failure',
    screenshot: 'on',
    video: 'retain-on-failure',
  },

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