Skip to content

Commit 6090ea8

Browse files
committed
fix: update sending custom information to Sauce Labs
This PR fixes sending custom data to Sauce Labs and let the capabilities overwrite the generic information
1 parent 4cc69fb commit 6090ea8

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

src/process-config.ts

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,24 @@ export function processConfig(config: any = {}, args: any = {}) {
3131
}
3232

3333
const capabilitiesFromConfig = {
34-
build: config.build,
34+
// Test annotation
35+
build: config.build || args.build,
36+
name: config.testName || args.testName || 'Saucelabs Launcher Tests',
37+
tags: config.tags || args.tags || [],
38+
'custom-data': config.customData || args.customData,
39+
customData: config.customData || args.customData || {},
40+
// Timeouts
41+
maxDuration: config.maxDuration || 1800,
3542
commandTimeout: config.commandTimeout || 300,
36-
customData: config.customData || {},
3743
idleTimeout: config.idleTimeout || 90,
38-
maxDuration: config.maxDuration || 1800,
39-
name: config.testName || 'Saucelabs Launcher Tests',
44+
// Custom Testing Options
4045
parentTunnel: config.parentTunnel,
41-
public: config.public || 'public',
42-
recordScreenshots: config.recordScreenshots,
43-
recordVideo: config.recordVideo,
44-
tags: config.tags || [],
4546
tunnelIdentifier: tunnelIdentifier,
46-
'custom-data': config.customData,
47+
timeZone: config.timeZone || args.timeZone,
48+
public: config.public || 'public',
49+
// Optional Testing Features
50+
recordScreenshots: config.recordScreenshots || args.recordScreenshots,
51+
recordVideo: config.recordVideo || config.recordVideo,
4752
};
4853

4954
const sauceConnectOptions = {
@@ -55,7 +60,7 @@ export function processConfig(config: any = {}, args: any = {}) {
5560
if (isW3C(args)) {
5661
args.browserVersion = args.browserVersion || args.version || 'latest'
5762
args.platformName = args.platformName || args.platform || 'Windows 10'
58-
args['sauce:options'] = { ...(args['sauce:options'] || {}), ...capabilitiesFromConfig }
63+
args['sauce:options'] = {...capabilitiesFromConfig, ...(args['sauce:options'] || {})}
5964

6065
// delete JWP capabilities
6166
delete args.version

0 commit comments

Comments
 (0)