44 lines
1.2 KiB
TypeScript
44 lines
1.2 KiB
TypeScript
import { defineConfig, devices } from "@playwright/test";
|
|
import path from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
const dataDir = path.resolve(__dirname, "./.pw-data");
|
|
const apiPort = 5099;
|
|
const uiPort = 5173;
|
|
|
|
export default defineConfig({
|
|
testDir: "./e2e",
|
|
timeout: 60_000,
|
|
fullyParallel: false,
|
|
workers: 1,
|
|
reporter: "list",
|
|
use: {
|
|
baseURL: `http://127.0.0.1:${uiPort}`,
|
|
trace: "off",
|
|
...devices["Desktop Chrome"],
|
|
},
|
|
webServer: [
|
|
{
|
|
// Fresh DB per run — the data dir is wiped in globalSetup.
|
|
command: `dotnet run --project ../src/VolcanicCore.Api --urls http://127.0.0.1:${apiPort}`,
|
|
cwd: __dirname,
|
|
env: {
|
|
ADMIN_PASSWORD: "hunter2",
|
|
DATA_DIRECTORY: dataDir,
|
|
},
|
|
url: `http://127.0.0.1:${apiPort}/api/health`,
|
|
timeout: 120_000,
|
|
reuseExistingServer: false,
|
|
},
|
|
{
|
|
command: `pnpm dev --host 127.0.0.1 --port ${uiPort}`,
|
|
cwd: __dirname,
|
|
url: `http://127.0.0.1:${uiPort}`,
|
|
timeout: 60_000,
|
|
reuseExistingServer: false,
|
|
},
|
|
],
|
|
globalSetup: "./e2e/fixtures.ts",
|
|
});
|