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

const isRemoteAdmin = String(process.env.E2E_REMOTE_ADMIN || '') === '1';

export default defineConfig({
  testDir: './tests/e2e/specs',
  globalSetup: './tests/e2e/global-setup.mjs',
  workers: 1,
  timeout: 180000,
  expect: { timeout: 15000 },
  retries: 0,
  reporter: [['list']],
  use: {
    baseURL: process.env.E2E_BASE_URL || 'http://127.0.0.1:8092',
    trace: 'on-first-retry',
    storageState: isRemoteAdmin ? './working/e2e-remote-auth.json' : undefined
  }
});
