35 lines
883 B
TypeScript
35 lines
883 B
TypeScript
import { defineConfig, devices } from "@playwright/test";
|
|
|
|
/**
|
|
* Playwright E2E config for EnFlow.
|
|
* Tests run against local dev server by default.
|
|
* Set BASE_URL env var to test against deployed instance.
|
|
*/
|
|
export default defineConfig({
|
|
testDir: "./src/__tests__/e2e",
|
|
fullyParallel: true,
|
|
forbidOnly: !!process.env.CI,
|
|
retries: process.env.CI ? 2 : 0,
|
|
workers: process.env.CI ? 1 : undefined,
|
|
reporter: "list",
|
|
use: {
|
|
baseURL: process.env.BASE_URL || "http://localhost:3000",
|
|
trace: "on-first-retry",
|
|
screenshot: "only-on-failure",
|
|
},
|
|
projects: [
|
|
{
|
|
name: "chromium",
|
|
use: { ...devices["Desktop Chrome"] },
|
|
},
|
|
],
|
|
webServer: process.env.BASE_URL
|
|
? undefined
|
|
: {
|
|
command: "npm run dev",
|
|
url: "http://localhost:3000",
|
|
reuseExistingServer: !process.env.CI,
|
|
timeout: 120000,
|
|
},
|
|
});
|