Skip to content

Commit f2239b5

Browse files
authored
test: respect CR/FF/WK/PATH env (#3015)
1 parent 91e1a25 commit f2239b5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/jest/fixtures.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ const { Transport } = require('../../lib/rpc/transport');
2525
const { PlaywrightDispatcher } = require('../../lib/rpc/server/playwrightDispatcher');
2626
const { setUseApiName } = require('../../lib/progress');
2727

28+
const browserName = process.env.BROWSER || 'chromium';
29+
2830
module.exports = function registerFixtures(global) {
2931
global.registerWorkerFixture('parallelIndex', async ({}, test) => {
3032
await test(process.env.JEST_WORKER_ID - 1);
@@ -58,10 +60,20 @@ module.exports = function registerFixtures(global) {
5860
});
5961

6062
global.registerWorkerFixture('defaultBrowserOptions', async({}, test) => {
63+
let executablePath = undefined;
64+
if (browserName === 'chromium' && process.env.CRPATH)
65+
executablePath = process.env.CRPATH;
66+
if (browserName === 'firefox' && process.env.FFPATH)
67+
executablePath = process.env.FFPATH;
68+
if (browserName === 'webkit' && process.env.WKPATH)
69+
executablePath = process.env.WKPATH;
70+
if (executablePath)
71+
console.error(`Using executable at ${executablePath}`);
6172
await test({
6273
handleSIGINT: false,
6374
slowMo: valueFromEnv('SLOW_MO', 0),
6475
headless: !!valueFromEnv('HEADLESS', true),
76+
executablePath
6577
});
6678
});
6779

0 commit comments

Comments
 (0)