fix(browser): detect Playwright chrome-linux64 cache

This commit is contained in:
Ayaan Zaidi
2026-05-10 10:57:40 +05:30
parent d40e062800
commit 3050b1568d
2 changed files with 7 additions and 5 deletions

View File

@@ -493,10 +493,12 @@ function findPlaywrightChromiumExecutableCandidatesLinux(): Array<BrowserExecuta
if (!entry.startsWith("chromium-")) {
continue;
}
candidates.push({
kind: "chromium",
path: path.join(browserPath, entry, "chrome-linux", "chrome"),
});
for (const linuxDir of ["chrome-linux64", "chrome-linux"]) {
candidates.push({
kind: "chromium",
path: path.join(browserPath, entry, linuxDir, "chrome"),
});
}
}
}
return candidates;

View File

@@ -368,7 +368,7 @@ describe("browser chrome helpers", () => {
it("finds Playwright-managed Linux Chromium", () => {
const browserPath = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-ms-playwright-"));
const executablePath = path.join(browserPath, "chromium-1217", "chrome-linux", "chrome");
const executablePath = path.join(browserPath, "chromium-1217", "chrome-linux64", "chrome");
vi.stubEnv("PLAYWRIGHT_BROWSERS_PATH", browserPath);
fs.mkdirSync(path.dirname(executablePath), { recursive: true });
const exists = mockExistsSync((pathValue) => pathValue === executablePath);