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

export default defineConfig({
  testDir: './tests/e2e',
  testMatch: /package-replace-regression\.spec\.ts/,
  outputDir: './storage/e2e-results',
  fullyParallel: false,
  workers: 1,
  reporter: [['list']],
  use: {
    baseURL: process.env.E2E_BASE_URL ?? 'http://readingful.test',
    trace: 'retain-on-failure',
    screenshot: 'only-on-failure',
    video: 'retain-on-failure',
  },
  projects: [
    {
      name: 'chromium',
      // The app shows a "rotate your device" gate below its landscape threshold.
      use: { ...devices['Desktop Chrome'], viewport: { width: 1728, height: 1080 } },
    },
  ],
});
