@wdio/config
Advanced tools
Comparing version 5.4.11 to 5.4.13
@@ -71,6 +71,13 @@ "use strict"; | ||
/** | ||
* For Sauce Labs RDC we need to determine if the config file has a `testobject_api_key` | ||
* If so, we need to provide a boolean to the `detectBackend` to set the correct hostname | ||
*/ | ||
const isRDC = this._capabilities.some(capability => 'testobject_api_key' in capability); | ||
/** | ||
* detect Selenium backend | ||
*/ | ||
this._config = (0, _deepmerge.default)((0, _utils.detectBackend)(this._config), this._config, MERGE_OPTIONS); | ||
this._config = (0, _deepmerge.default)((0, _utils.detectBackend)(this._config, isRDC), this._config, MERGE_OPTIONS); | ||
} catch (e) { | ||
@@ -77,0 +84,0 @@ log.error(`Failed loading configuration file: ${filePath}:`, e.message); |
@@ -19,5 +19,10 @@ "use strict"; | ||
function getSauceEndpoint(region) { | ||
const dc = region ? typeof REGION_MAPPING[region] !== 'undefined' ? REGION_MAPPING[region] : region + '.' : ''; | ||
return `${dc}saucelabs.com`; | ||
function getSauceEndpoint(region, isRDC) { | ||
const dcRegion = REGION_MAPPING[region] ? region : 'us'; | ||
if (isRDC) { | ||
return `${dcRegion}1.appium.testobject.com`; | ||
} | ||
return `${REGION_MAPPING[dcRegion]}saucelabs.com`; | ||
} | ||
@@ -29,3 +34,3 @@ /** | ||
function detectBackend(options = {}) { | ||
function detectBackend(options = {}, isRDC = false) { | ||
const { | ||
@@ -69,6 +74,10 @@ port, | ||
if (typeof user === 'string' && key.length === 36) { | ||
if (typeof user === 'string' && key.length === 36 || // When SC is used a user needs to be provided and `isRDC` needs to be true | ||
typeof user === 'string' && isRDC || // Or only RDC | ||
isRDC) { | ||
// For the VM cloud a prefix needs to be added, the RDC cloud doesn't have that | ||
const preFix = isRDC ? '' : 'ondemand.'; | ||
return { | ||
protocol: protocol || 'https', | ||
hostname: hostname || `ondemand.${getSauceEndpoint(region)}`, | ||
hostname: hostname || preFix + getSauceEndpoint(region, isRDC), | ||
port: port || 443 | ||
@@ -75,0 +84,0 @@ }; |
{ | ||
"name": "@wdio/config", | ||
"version": "5.4.11", | ||
"version": "5.4.13", | ||
"description": "A helper utility to parse and validate WebdriverIO options", | ||
@@ -40,3 +40,3 @@ "author": "Christian Bromann <christian@saucelabs.com>", | ||
}, | ||
"gitHead": "8dba3695bd0dffac069be2309d4e0358916e2f75" | ||
"gitHead": "2501a3fb559163b6806f61092816b97d21c1825f" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21668
613