Repository navigation
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
75 lines (73 loc) · 3.62 KB
/
Copy pathplaywright.config.ts
File metadata and controls
75 lines (73 loc) · 3.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import { defineConfig, devices } from "@playwright/test";
const dashboardPort = process.env.DASHBOARD_PORT || process.env.PORT || "20128";
const dashboardBaseUrl = `http://localhost:${dashboardPort}`;
const webServerReadyUrl = `${dashboardBaseUrl}/api/monitoring/health`;
const playwrightServerMode = process.env.OMNIROUTE_PLAYWRIGHT_SERVER_MODE || "start";
const playwrightWebServerTimeout = Number.parseInt(
process.env.OMNIROUTE_PLAYWRIGHT_WEB_SERVER_TIMEOUT || "900000",
10
);
export default defineConfig({
testDir: "./tests/e2e",
testMatch: ["**/*.spec.ts"],
// Specs still written against the pre-Nav-Restructure layout. Every entry needs a reason;
// realign the spec and drop it from this list instead of adding new ones.
// `settings-toggles` was realigned to the current routes (KEA-7886 follow-up, owner
// decision P1: /dashboard/settings stays a redirect to its sub-routes).
testIgnore: [
// Expects five in-page tabs on /dashboard/analytics; analytics is now split into the
// sub-routes /dashboard/analytics/{evals,search,utilization,combo-health,…}.
"**/analytics-tabs.spec.ts",
// Expects MCP/A2A tabs inside /dashboard/endpoint's segmented control, which the Nav
// Restructure removed.
"**/protocol-visibility.spec.ts",
// Opens /dashboard/settings?tab=resilience and reads a "Resilience" tabpanel; the legacy
// query now redirects to /dashboard/settings/resilience, which has no tab panel.
"**/resilience-plan-alignment.spec.ts",
// Realigned to /dashboard/settings/ai + /dashboard/memory, but "updates memory config and
// deletes stored memory entries" still fails on the kit DOM (toBeVisible on the entries
// list). Realign in #18079 (UI kit follow-ups — tests and infra).
"**/memory-settings.spec.ts",
// Realigned to /dashboard/omni-skills, but the lookupWeather row has no role="switch" on
// the kit DOM (toHaveAttribute aria-checked). Realign in #18079.
"**/skills-marketplace.spec.ts",
],
fullyParallel: false,
// Per-test cap. 600s was high enough that one hung test (× retries) could
// exhaust the e2e job's wall-clock budget, so the GitHub job hit its
// timeout-minutes and was CANCELLED mid-run instead of the test failing fast.
// 180s is generous for a UI flow yet bounds a hang to a clear per-test failure.
timeout: 180_000,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: 1,
// `line` (not `github`) in CI so per-test progress + timing stream live to the
// job log. The `github` reporter buffers all output until the run ends, so when
// a slow shard was cancelled at its timeout the log showed only "Running N
// tests" then silence — impossible to tell which test was slow/hung.
reporter: process.env.CI ? "line" : "html",
expect: {
timeout: process.env.CI ? 30_000 : 10_000,
},
use: {
baseURL: dashboardBaseUrl,
navigationTimeout: 300_000,
trace: "on-first-retry",
screenshot: "only-on-failure",
},
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
],
webServer: {
command: `${JSON.stringify(process.execPath)} scripts/dev/run-next-playwright.mjs ${playwrightServerMode}`,
url: webServerReadyUrl,
reuseExistingServer: !process.env.CI,
timeout: Number.isFinite(playwrightWebServerTimeout) ? playwrightWebServerTimeout : 900_000,
// Opt-in: Playwright discards the webServer's stdout by default, which hides both the build
// and the server's own logs when the readiness wait times out (nightly a11y, #16853).
stdout: process.env.OMNIROUTE_PLAYWRIGHT_WEB_SERVER_STDOUT === "pipe" ? "pipe" : "ignore",
},
});