fix(hwlab): stabilize d518 source workspace browser checks

This commit is contained in:
Codex
2026-06-27 18:09:16 +00:00
parent 90ab0d4991
commit 888334f5ae
2 changed files with 35 additions and 1 deletions
+7 -1
View File
@@ -1883,6 +1883,8 @@ function probeSentinelDashboardBrowser(state: SentinelCicdState, options: Extrac
`export UNIDESK_SENTINEL_DASHBOARD_HEIGHT=${shellQuote(heightRaw ?? "900")}`,
`export UNIDESK_SENTINEL_DASHBOARD_TIMEOUT_MS=${shellQuote(String(options.timeoutMs))}`,
`export UNIDESK_SENTINEL_DASHBOARD_FULL_PAGE=${shellQuote(options.fullPage ? "1" : "0")}`,
`export UNIDESK_SENTINEL_DASHBOARD_PLAYWRIGHT_MODULE=${shellQuote(`${state.spec.workspace}/node_modules/playwright/index.mjs`)}`,
"export PLAYWRIGHT_BROWSERS_PATH=0",
"if command -v chromium >/dev/null 2>&1; then",
" export UNIDESK_SENTINEL_DASHBOARD_EXECUTABLE_PATH=$(command -v chromium)",
"elif command -v chromium-browser >/dev/null 2>&1; then",
@@ -1949,7 +1951,11 @@ function probeSentinelDashboardBrowser(state: SentinelCicdState, options: Extrac
}
function sentinelDashboardBrowserModule(): string {
return String.raw`import { chromium } from "playwright";
return String.raw`import { pathToFileURL } from "node:url";
const playwrightModulePath = process.env.UNIDESK_SENTINEL_DASHBOARD_PLAYWRIGHT_MODULE || "";
const playwrightModuleSpecifier = playwrightModulePath ? pathToFileURL(playwrightModulePath).href : "playwright";
const { chromium } = await import(playwrightModuleSpecifier);
const url = process.env.UNIDESK_SENTINEL_DASHBOARD_URL;
const screenshotPath = process.env.UNIDESK_SENTINEL_DASHBOARD_SCREENSHOT || "";