Skip to content

Commit

Permalink
fix: correctly convert JWP capabilities to W3C
Browse files Browse the repository at this point in the history
The `processConfig()` function attempts to convert capabilities from the
deprecated JWP format to the new standard W3C one.

Fix the logic for detecting when capabilites are in JWP format.
(Previously, the logic was inverted.)

Also, make sure that the `sauce:options` property is correctly populated
in both cases.
  • Loading branch information
gkalpak committed Oct 24, 2022
1 parent 69dcb82 commit 669abe6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/process-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,17 @@ export function processConfig(config: any = {}, args: any = {}) {
};

// transform JWP capabilities into W3C capabilities for backward compatibility
if (isW3C(args)) {
if (!isW3C(args)) {
args.browserVersion = args.browserVersion || args.version || 'latest'
args.platformName = args.platformName || args.platform || 'Windows 10'
args['sauce:options'] = {...capabilitiesFromConfig, ...(args['sauce:options'] || {})}

// delete JWP capabilities
delete args.version
delete args.platform
} else {
args = {...args, ...capabilitiesFromConfig}
}

args['sauce:options'] = {...capabilitiesFromConfig, ...(args['sauce:options'] || {})}

// Not needed
delete args.base

Expand Down

0 comments on commit 669abe6

Please sign in to comment.