mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-25 16:37:32 +00:00
* fix(studio): browser test scripts launch the Chrome Studio itself picks The scripts in tests/e2e chose Chrome from their own list: a system Chrome before the downloaded one, and no version check, so an old system Chrome hung every script at browser start. They now use Studio's one finder (an environment variable first, then the downloaded Chrome, then a system Chrome new enough), moved to a file plain Node can load. * test(studio): the Chrome finder test builds its path as the finder does The finder joins the cache path with the host's separator, so on a Windows runner the stand-in never saw the path the test spelled with forward slashes.
21 lines
771 B
JavaScript
21 lines
771 B
JavaScript
import puppeteer from "puppeteer-core";
|
|
import { findSystemChrome } from "../../vite.chrome.ts";
|
|
|
|
/** The Chrome every Studio browser acceptance test launches: the one Studio's dev server picks. */
|
|
export const resolveChromeExecutable = findSystemChrome;
|
|
|
|
/** Headless Chrome for a Studio browser gate; exits 2 when no Chrome is installed. */
|
|
export async function launchStudioChrome() {
|
|
const executablePath = resolveChromeExecutable();
|
|
if (!executablePath) {
|
|
console.error("No Chrome executable found; set PUPPETEER_EXECUTABLE_PATH");
|
|
process.exit(2);
|
|
}
|
|
const browser = await puppeteer.launch({
|
|
executablePath,
|
|
headless: true,
|
|
args: ["--no-sandbox", "--disable-dev-shm-usage", "--disable-gpu"],
|
|
});
|
|
return { browser, executablePath };
|
|
}
|