MCPcopy Create free account
hub / github.com/code-pushup/cli / installBrowser

Method installBrowser

packages/plugin-axe/src/lib/runner/run-axe.ts:114–135  ·  view source on GitHub ↗

* Ensures Chromium browser binary is installed before running accessibility audits. * * Uses Node's module resolution and npm's bin specification to locate playwright-core CLI, * working reliably with all package managers (npm, pnpm, yarn).

()

Source from the content-addressed store, hash-verified

112 * working reliably with all package managers (npm, pnpm, yarn).
113 */
114 private async installBrowser(): Promise<void> {
115 if (this.browserInstalled) {
116 return;
117 }
118
119 logger.debug('Checking Chromium browser installation ...');
120
121 const require = createRequire(import.meta.url);
122 const pkgPath = require.resolve('playwright-core/package.json');
123 const pkg = require(pkgPath);
124 const cliPath = path.join(
125 path.dirname(pkgPath),
126 pkg.bin['playwright-core'],
127 );
128
129 await executeProcess({
130 command: 'node',
131 args: [cliPath, 'install', 'chromium'],
132 });
133
134 this.browserInstalled = true;
135 }
136
137 /** Lazily launches or returns existing Chromium browser instance. */
138 private async launchBrowser(): Promise<Browser> {

Callers 1

launchBrowserMethod · 0.95

Calls 2

executeProcessFunction · 0.90
debugMethod · 0.45

Tested by

no test coverage detected