feat(tests): Adds target for grid ff tests.

This commit is contained in:
damencho
2025-02-14 15:15:26 -06:00
committed by Дамян Минков
parent f2d9ffd5f6
commit 15a4fa45e0
3 changed files with 24 additions and 4 deletions

View File

@@ -228,7 +228,9 @@
"test-dev": "DOTENV_CONFIG_PATH=tests/.env wdio run tests/wdio.dev.conf.ts",
"test-dev-single": "DOTENV_CONFIG_PATH=tests/.env wdio run tests/wdio.dev.conf.ts --spec",
"test-grid": "DOTENV_CONFIG_PATH=tests/.env wdio run tests/wdio.grid.conf.ts",
"test-grid-single": "DOTENV_CONFIG_PATH=tests/.env wdio run tests/wdio.grid.conf.ts --spec"
"test-grid-single": "DOTENV_CONFIG_PATH=tests/.env wdio run tests/wdio.grid.conf.ts --spec",
"test-grid-ff": "DOTENV_CONFIG_PATH=tests/.env wdio run tests/wdio.grid.firefox.conf.ts",
"test-grid-ff-single": "DOTENV_CONFIG_PATH=tests/.env wdio run tests/wdio.grid.firefox.conf.ts --spec"
},
"resolutions": {
"@types/react": "17.0.14",

View File

@@ -1,6 +1,5 @@
// wdio.grid.conf.ts
// extends the main configuration file to add the selenium grid address
import { merge } from 'lodash-es';
import { URL } from 'url';
// @ts-ignore
@@ -9,13 +8,14 @@ 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 = merge(defaultConfig, {
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
}, { clone: false });
};
mergedConfig.capabilities.participant1.capabilities['goog:chromeOptions'].args
= updateRemoteResource(mergedConfig.capabilities.participant1.capabilities['goog:chromeOptions'].args);

View File

@@ -0,0 +1,18 @@
// 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.firefox.conf.ts';
const gridUrl = new URL(process.env.GRID_HOST_URL as string);
const protocol = gridUrl.protocol.replace(':', '');
export const config = {
...defaultConfig,
protocol,
hostname: gridUrl.hostname,
port: gridUrl.port ? parseInt(gridUrl.port, 10) // Convert port to number
: protocol === 'http' ? 80 : 443,
path: gridUrl.pathname
};