fix(hwlab): stabilize d518 source workspace browser checks
This commit is contained in:
@@ -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 || "";
|
||||
|
||||
Reference in New Issue
Block a user