snapshot of https://github.com/jitsi/jitsi-meet.git @ fd1749dd28f4138aa80234fc7f311b19aaffa0e7 (2026-09-15)
This commit is contained in:
36
tests/wdio.grid.conf.ts
Normal file
36
tests/wdio.grid.conf.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
// wdio.grid.conf.ts
|
||||
// extends the main configuration file to add the selenium grid address
|
||||
import { URL } from 'url';
|
||||
|
||||
// @ts-ignore
|
||||
import { config as defaultConfig } from './wdio.conf.ts';
|
||||
|
||||
const gridUrl = new URL(process.env.GRID_HOST_URL as string);
|
||||
const protocol = gridUrl.protocol.replace(':', '');
|
||||
|
||||
const mergedConfig = {
|
||||
...defaultConfig,
|
||||
protocol,
|
||||
hostname: gridUrl.hostname,
|
||||
port: gridUrl.port ? parseInt(gridUrl.port, 10) // Convert port to number
|
||||
: protocol === 'http' ? 80 : 443,
|
||||
path: gridUrl.pathname
|
||||
};
|
||||
|
||||
Object.keys(mergedConfig.capabilities).forEach(browser => {
|
||||
mergedConfig.capabilities[browser].capabilities['goog:chromeOptions'].args
|
||||
= updateRemoteResource(mergedConfig.capabilities[browser].capabilities['goog:chromeOptions'].args);
|
||||
});
|
||||
|
||||
export const config = mergedConfig;
|
||||
|
||||
/**
|
||||
* Updates the array of arguments for the Chrome browser to use a remote resource for fake audio capture.
|
||||
* @param arr
|
||||
*/
|
||||
function updateRemoteResource(arr: string[]): string[] {
|
||||
// eslint-disable-next-line no-confusing-arrow
|
||||
return arr.map((item: string) => item.startsWith('--use-file-for-fake-audio-capture=')
|
||||
? `--use-file-for-fake-audio-capture=${process.env.REMOTE_RESOURCE_PATH}/fakeAudioStream.wav` : item
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user