- Introduced unit tests for edge gateway workflow helpers, including workflow step resolution, incident action mapping, relay health row formatting, and workspace state merging. - Added new components for advanced operations, configuration panel, context panel, fleet rail, and health summary. - Enhanced gateway management UI with support for advanced actions, fallback operations, relay health visualization, and device binding features.
71 lines
2.4 KiB
TypeScript
71 lines
2.4 KiB
TypeScript
import path from "node:path";
|
|
import { defineConfig, devices } from "@playwright/test";
|
|
|
|
const devPort = Number(process.env.PLAYWRIGHT_DEV_PORT || 5173);
|
|
const baseURL = process.env.PLAYWRIGHT_BASE_URL || `http://localhost:${devPort}`;
|
|
const isCI = !!process.env.CI;
|
|
const artifactNamespace = (process.env.PLAYWRIGHT_ARTIFACT_NAMESPACE || "").trim();
|
|
const artifactRoot = artifactNamespace
|
|
? path.join("output", "playwright", artifactNamespace)
|
|
: path.join("output", "playwright");
|
|
const htmlReportOutputFolder = path.join(artifactRoot, "report");
|
|
const configuredWorkers = Number(process.env.PLAYWRIGHT_WORKERS || 2);
|
|
const workers = Number.isFinite(configuredWorkers) && configuredWorkers > 0 ? configuredWorkers : 2;
|
|
const reporterMode = (process.env.PLAYWRIGHT_REPORTER_MODE || "").trim();
|
|
const reporter =
|
|
reporterMode === "line-html"
|
|
? [["line"], ["html", { open: "never", outputFolder: htmlReportOutputFolder }]]
|
|
: [["list"], ["html", { open: "never", outputFolder: htmlReportOutputFolder }]];
|
|
|
|
function buildProject(name: string, browserName: "chromium" | "firefox" | "webkit", deviceName: keyof typeof devices) {
|
|
const { defaultBrowserType, ...device } = devices[deviceName];
|
|
const use = {
|
|
browserName,
|
|
...device,
|
|
};
|
|
|
|
if (browserName === "firefox") {
|
|
delete use.isMobile;
|
|
}
|
|
|
|
return {
|
|
name,
|
|
use,
|
|
};
|
|
}
|
|
|
|
export default defineConfig({
|
|
testDir: "./tests/e2e",
|
|
testIgnore: ["**/release/**"],
|
|
timeout: 60_000,
|
|
fullyParallel: true,
|
|
forbidOnly: isCI,
|
|
retries: isCI ? 2 : 0,
|
|
workers,
|
|
...(process.env.PLAYWRIGHT_BASE_URL
|
|
? {}
|
|
: {
|
|
globalSetup: "./playwright.global-setup.mjs",
|
|
globalTeardown: "./playwright.global-teardown.mjs",
|
|
}),
|
|
reporter,
|
|
outputDir: path.join(artifactRoot, "test-results"),
|
|
use: {
|
|
baseURL,
|
|
trace: "retain-on-failure",
|
|
screenshot: "only-on-failure",
|
|
video: "retain-on-failure",
|
|
},
|
|
projects: [
|
|
buildProject("chromium-desktop", "chromium", "Desktop Chrome"),
|
|
buildProject("chromium-tablet", "chromium", "iPad Mini"),
|
|
buildProject("chromium-mobile", "chromium", "Pixel 5"),
|
|
buildProject("firefox-desktop", "firefox", "Desktop Firefox"),
|
|
buildProject("firefox-tablet", "firefox", "iPad Mini"),
|
|
buildProject("firefox-mobile", "firefox", "Pixel 5"),
|
|
buildProject("webkit-desktop", "webkit", "Desktop Safari"),
|
|
buildProject("webkit-tablet", "webkit", "iPad Mini"),
|
|
buildProject("webkit-mobile", "webkit", "iPhone 12"),
|
|
],
|
|
});
|