mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-04 18:34:02 +00:00
Seven QA scripts hard-coded macOS Google Chrome. They now share chromeExecutablePath(): PUPPETEER_EXECUTABLE_PATH when set, then macOS Chrome when installed, otherwise Puppeteer's managed browser. The cables screenshot path is built with fileURLToPath so it works on Windows. qa-overlay-baseline keeps its fixed Chrome because its baselines record the executable. Co-authored-by: Sameh Khamis <[email protected]>
28 lines
743 B
JavaScript
28 lines
743 B
JavaScript
import assert from 'node:assert/strict';
|
||
import test from 'node:test';
|
||
import { MACOS_CHROME, chromeExecutablePath } from '../scripts/qa-chrome.mjs';
|
||
|
||
test('gates keep macOS Chrome where it is installed', () => {
|
||
assert.equal(
|
||
chromeExecutablePath({ env: {}, exists: (p) => p === MACOS_CHROME }),
|
||
MACOS_CHROME,
|
||
);
|
||
});
|
||
|
||
test('gates fall back to Puppeteer’s browser without macOS Chrome', () => {
|
||
assert.equal(
|
||
chromeExecutablePath({ env: {}, exists: () => false }),
|
||
undefined,
|
||
);
|
||
});
|
||
|
||
test('an explicit executable path wins', () => {
|
||
assert.equal(
|
||
chromeExecutablePath({
|
||
env: { PUPPETEER_EXECUTABLE_PATH: 'C:\\Chrome\\chrome.exe' },
|
||
exists: () => true,
|
||
}),
|
||
'C:\\Chrome\\chrome.exe',
|
||
);
|
||
});
|