summaryrefslogtreecommitdiff
path: root/test/web_snapshot.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'test/web_snapshot.mjs')
-rw-r--r--test/web_snapshot.mjs6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/web_snapshot.mjs b/test/web_snapshot.mjs
index 7b40c174..a1912f15 100644
--- a/test/web_snapshot.mjs
+++ b/test/web_snapshot.mjs
@@ -446,6 +446,12 @@ async function findChrome() {
const found = childProcess.spawnSync("which", [command], { encoding: "utf8" });
if (found.status === 0 && found.stdout.trim()) candidates.push(found.stdout.trim());
}
+ // macOS installs a browser as an application BUNDLE, whose executable is
+ // buried inside it and never on PATH, so the lookup above finds nothing on
+ // a Mac that has Chrome sitting in /Applications.
+ if (process.platform === "darwin")
+ for (const app of ["Google Chrome", "Chromium", "Google Chrome Canary"])
+ candidates.push(`/Applications/${app}.app/Contents/MacOS/${app}`);
const cache = process.env.PLAYWRIGHT_BROWSERS_PATH || path.join(os.homedir(), ".cache", "ms-playwright");
for (const entry of await fsp.readdir(cache).catch(() => [])) {
if (entry.startsWith("chromium-")) {