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.
45 lines
1.5 KiB
TypeScript
45 lines
1.5 KiB
TypeScript
import { join } from "node:path";
|
|
import { describe, expect, it } from "vitest";
|
|
import { resolveChromeExecutable } from "./e2e/chrome-executable.mjs";
|
|
|
|
const SYSTEM = "/usr/bin/google-chrome";
|
|
// Joined as the finder joins it, so the path matches on a Windows runner too.
|
|
const DOWNLOADED = join("/cache", "chrome", "linux-155.0.8059.39", "chrome-linux64", "chrome");
|
|
const OLD = () => "Google Chrome 113.0.5672.63";
|
|
|
|
describe("the Chrome Studio's browser test scripts launch", () => {
|
|
// fails without the fix: the scripts' own list tried a system Chrome first and never read its version.
|
|
it("is the downloaded Chrome, even beside a system Chrome", () => {
|
|
const found = resolveChromeExecutable(
|
|
{ PUPPETEER_CACHE_DIR: "/cache" },
|
|
(path) => path === SYSTEM || path === DOWNLOADED,
|
|
"linux",
|
|
OLD,
|
|
() => ["linux-155.0.8059.39"],
|
|
);
|
|
expect(found).toBe(DOWNLOADED);
|
|
});
|
|
|
|
it("is never a system Chrome too old for Studio", () => {
|
|
const found = resolveChromeExecutable(
|
|
{ PUPPETEER_CACHE_DIR: "/cache" },
|
|
(path) => path === SYSTEM,
|
|
"linux",
|
|
OLD,
|
|
() => [],
|
|
);
|
|
expect(found).toBeUndefined();
|
|
});
|
|
|
|
it("is the one an environment variable names, before either", () => {
|
|
const found = resolveChromeExecutable(
|
|
{ PUPPETEER_CACHE_DIR: "/cache", CHROME_PATH: "/pinned/chrome" },
|
|
() => true,
|
|
"linux",
|
|
OLD,
|
|
() => ["linux-155.0.8059.39"],
|
|
);
|
|
expect(found).toBe("/pinned/chrome");
|
|
});
|
|
});
|