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

const baseURL = process.env.BASE_URL;

if (!baseURL) {
  throw new Error("BASE_URL is required");
}

export default defineConfig({
  testDir: "./setup",
  outputDir: "./output/bootstrap-test-results",
  workers: 1,
  forbidOnly: true,
  retries: 0,
  timeout: 60_000,
  expect: {
    timeout: 10_000,
  },
  reporter: [["line"]],
  use: {
    baseURL,
    ignoreHTTPSErrors: true,
    ...devices["Desktop Chrome"],
    actionTimeout: 10_000,
    navigationTimeout: 20_000,
    trace: "retain-on-failure",
    screenshot: "only-on-failure",
  },
});
