@wdio/sauce-service 8.0.2 → 8.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/launcher.d.ts.map +1 -1
- package/build/launcher.js +16 -20
- package/build/service.d.ts +1 -1
- package/build/service.d.ts.map +1 -1
- package/build/service.js +11 -2
- package/build/utils.d.ts +1 -1
- package/build/utils.d.ts.map +1 -1
- package/build/utils.js +5 -15
- package/package.json +6 -7
package/build/launcher.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launcher.d.ts","sourceRoot":"","sources":["../src/launcher.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"launcher.d.ts","sourceRoot":"","sources":["../src/launcher.ts"],"names":[],"mappings":"AAGA,OAAkB,EAAoB,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAA;AAElG,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAGlE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAMjD,MAAM,CAAC,OAAO,OAAO,aAAc,YAAW,QAAQ,CAAC,eAAe;IAK9D,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,aAAa;IACrB,OAAO,CAAC,OAAO;IANnB,OAAO,CAAC,IAAI,CAAW;IACvB,OAAO,CAAC,oBAAoB,CAAC,CAAsB;gBAGvC,QAAQ,EAAE,kBAAkB,EAC5B,aAAa,EAAE,OAAO,EACtB,OAAO,EAAE,OAAO,CAAC,UAAU;IAMvC;;OAEG;IACG,SAAS,CACX,MAAM,EAAE,OAAO,CAAC,UAAU,EAC1B,YAAY,EAAE,YAAY,CAAC,kBAAkB;IAyD3C,WAAW,CAAE,gBAAgB,EAAE,mBAAmB,EAAE,UAAU,SAAI,GAAG,OAAO,CAAC,oBAAoB,CAAC;IA4BxG;;OAEG;IACH,UAAU;CAOb"}
|
package/build/launcher.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { performance, PerformanceObserver } from 'node:perf_hooks';
|
|
2
|
+
import ip from 'ip';
|
|
2
3
|
import SauceLabs from 'saucelabs';
|
|
3
4
|
import logger from '@wdio/logger';
|
|
4
5
|
import { makeCapabilityFactory } from './utils.js';
|
|
5
|
-
|
|
6
|
-
'The "scRelay" option is depcrecated and will be removed',
|
|
7
|
-
'with the upcoming versions of @wdio/sauce-service. Please',
|
|
8
|
-
'remove the option as tests should work identically without it.'
|
|
9
|
-
].join(' ');
|
|
6
|
+
import path from 'node:path';
|
|
10
7
|
const MAX_SC_START_TRIALS = 3;
|
|
11
8
|
const log = logger('@wdio/sauce-service');
|
|
12
9
|
export default class SauceLauncher {
|
|
@@ -19,7 +16,8 @@ export default class SauceLauncher {
|
|
|
19
16
|
this._options = _options;
|
|
20
17
|
this._capabilities = _capabilities;
|
|
21
18
|
this._config = _config;
|
|
22
|
-
|
|
19
|
+
// @ts-expect-error https://github.com/saucelabs/node-saucelabs/issues/153
|
|
20
|
+
this._api = new SauceLabs.default(this._config);
|
|
23
21
|
}
|
|
24
22
|
/**
|
|
25
23
|
* modify config and launch sauce connect
|
|
@@ -36,20 +34,16 @@ export default class SauceLauncher {
|
|
|
36
34
|
const sauceConnectOpts = {
|
|
37
35
|
noAutodetect: true,
|
|
38
36
|
tunnelIdentifier: sauceConnectTunnelIdentifier,
|
|
39
|
-
...this._options.sauceConnectOpts
|
|
37
|
+
...this._options.sauceConnectOpts,
|
|
38
|
+
noSslBumpDomains: `127.0.0.1,localhost,${ip.address()}` + (this._options.sauceConnectOpts?.noSslBumpDomains
|
|
39
|
+
? `,${this._options.sauceConnectOpts.noSslBumpDomains}`
|
|
40
|
+
: ''),
|
|
41
|
+
logger: this._options.sauceConnectOpts?.logger || ((output) => log.debug(`Sauce Connect Log: ${output}`)),
|
|
42
|
+
...(!this._options.sauceConnectOpts?.logfile && this._config.outputDir
|
|
43
|
+
? { logfile: path.join(this._config.outputDir, 'wdio-sauce-connect-tunnel.log') }
|
|
44
|
+
: {})
|
|
40
45
|
};
|
|
41
|
-
|
|
42
|
-
if (this._options.scRelay) {
|
|
43
|
-
log.warn(SC_RELAY_DEPCRECATION_WARNING);
|
|
44
|
-
const scRelayPort = sauceConnectOpts.sePort || 4445;
|
|
45
|
-
sauceConnectOpts.sePort = scRelayPort;
|
|
46
|
-
endpointConfigurations = {
|
|
47
|
-
protocol: 'http',
|
|
48
|
-
hostname: 'localhost',
|
|
49
|
-
port: scRelayPort
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
const prepareCapability = makeCapabilityFactory(sauceConnectTunnelIdentifier, endpointConfigurations);
|
|
46
|
+
const prepareCapability = makeCapabilityFactory(sauceConnectTunnelIdentifier);
|
|
53
47
|
if (Array.isArray(capabilities)) {
|
|
54
48
|
for (const capability of capabilities) {
|
|
55
49
|
prepareCapability(capability);
|
|
@@ -69,10 +63,12 @@ export default class SauceLauncher {
|
|
|
69
63
|
log.info(`Sauce Connect successfully started after ${entry.duration}ms`);
|
|
70
64
|
});
|
|
71
65
|
obs.observe({ entryTypes: ['measure'] });
|
|
66
|
+
log.info('Starting Sauce Connect Tunnel');
|
|
72
67
|
performance.mark('sauceConnectStart');
|
|
73
68
|
this._sauceConnectProcess = await this.startTunnel(sauceConnectOpts);
|
|
74
69
|
performance.mark('sauceConnectEnd');
|
|
75
|
-
performance.measure('bootTime', 'sauceConnectStart', 'sauceConnectEnd');
|
|
70
|
+
const bootimeMeasure = performance.measure('bootTime', 'sauceConnectStart', 'sauceConnectEnd');
|
|
71
|
+
log.info(`Started Sauce Connect Tunnel within ${bootimeMeasure.duration}ms`);
|
|
76
72
|
}
|
|
77
73
|
async startTunnel(sauceConnectOpts, retryCount = 0) {
|
|
78
74
|
try {
|
package/build/service.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export default class SauceService implements Services.ServiceInstance {
|
|
|
20
20
|
/**
|
|
21
21
|
* gather information about runner
|
|
22
22
|
*/
|
|
23
|
-
beforeSession(
|
|
23
|
+
beforeSession(config: Options.Testrunner, __: never, ___: never, cid: string): void;
|
|
24
24
|
before(caps: unknown, specs: string[], browser: Browser<'async'> | MultiRemoteBrowser<'async'>): void;
|
|
25
25
|
beforeSuite(suite: Frameworks.Suite): Promise<void>;
|
|
26
26
|
beforeTest(test: Frameworks.Test): Promise<unknown>;
|
package/build/service.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAIA,OAAkB,EAAoB,GAAG,EAAE,MAAM,WAAW,CAAA;AAE5D,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAC9E,OAAO,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAI9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAMjD,MAAM,CAAC,OAAO,OAAO,YAAa,YAAW,QAAQ,CAAC,eAAe;IAgB7D,OAAO,CAAC,aAAa;IACrB,OAAO,CAAC,OAAO;IAhBnB,OAAO,CAAC,QAAQ,CAAI;IACpB,OAAO,CAAC,oBAAoB,CAAI;IAChC,OAAO,CAAC,SAAS,CAAI;IACrB,OAAO,CAAC,iBAAiB,CAAO;IAChC,OAAO,CAAC,aAAa,CAAQ;IAE7B,OAAO,CAAC,QAAQ,CAAoB;IACpC,OAAO,CAAC,IAAI,CAAW;IACvB,OAAO,CAAC,QAAQ,CAAC,CAAgD;IACjE,OAAO,CAAC,MAAM,CAAC,CAAS;IACxB,OAAO,CAAC,WAAW,CAAC,CAAQ;IAC5B,OAAO,CAAC,IAAI,CAAK;gBAGb,OAAO,EAAE,kBAAkB,EACnB,aAAa,EAAE,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M,EAAE,cAAc,UAAQ,EAAE,WAAW,CAAC,EAAE,MAAM;IAMlG;;OAEG;IACH,OAAO,CAAE,QAAQ,EAAE,MAAM,EAAE,cAAc,UAAQ,EAAE,WAAW,CAAC,EAAE,MAAM;IAgDvE;;OAEG;IACG,aAAa,CAAE,UAAU,EAAE,MAAM;YAmBzB,WAAW;CAa5B"}
|
package/build/service.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import fs from 'node:fs/promises';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
+
import ip from 'ip';
|
|
3
4
|
import SauceLabs from 'saucelabs';
|
|
4
5
|
import logger from '@wdio/logger';
|
|
5
6
|
import { isRDC, ansiRegex } from './utils.js';
|
|
@@ -24,13 +25,15 @@ export default class SauceService {
|
|
|
24
25
|
this._capabilities = _capabilities;
|
|
25
26
|
this._config = _config;
|
|
26
27
|
this._options = { ...DEFAULT_OPTIONS, ...options };
|
|
27
|
-
|
|
28
|
+
// @ts-expect-error https://github.com/saucelabs/node-saucelabs/issues/153
|
|
29
|
+
this._api = new SauceLabs.default(this._config);
|
|
28
30
|
this._maxErrorStackLength = this._options.maxErrorStackLength || this._maxErrorStackLength;
|
|
29
31
|
}
|
|
30
32
|
/**
|
|
31
33
|
* gather information about runner
|
|
32
34
|
*/
|
|
33
|
-
beforeSession(
|
|
35
|
+
beforeSession(config, __, ___, cid) {
|
|
36
|
+
console.log('beforeSession');
|
|
34
37
|
this._cid = cid;
|
|
35
38
|
/**
|
|
36
39
|
* if no user and key is specified even though a sauce service was
|
|
@@ -45,6 +48,12 @@ export default class SauceService {
|
|
|
45
48
|
this._isServiceEnabled = false;
|
|
46
49
|
this._config.key = 'unknown_key';
|
|
47
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* update baseUrl if localhost so it can be reached by Sauce Connect
|
|
53
|
+
*/
|
|
54
|
+
if (config.baseUrl && config.baseUrl.includes('localhost')) {
|
|
55
|
+
config.baseUrl = config.baseUrl.replace(/(localhost|127\.0\.0\.1)/, ip.address());
|
|
56
|
+
}
|
|
48
57
|
}
|
|
49
58
|
before(caps, specs, browser) {
|
|
50
59
|
this._browser = browser;
|
package/build/utils.d.ts
CHANGED
|
@@ -53,6 +53,6 @@ export declare function isEmuSim(caps: Capabilities.DesiredCapabilities): boolea
|
|
|
53
53
|
* @param {object} options - Additional options to set on the capability
|
|
54
54
|
* @returns {function(object): void} - A function that mutates a single capability
|
|
55
55
|
*/
|
|
56
|
-
export declare function makeCapabilityFactory(tunnelIdentifier: string
|
|
56
|
+
export declare function makeCapabilityFactory(tunnelIdentifier: string): (capability: Capabilities.DesiredCapabilities) => void;
|
|
57
57
|
export declare function ansiRegex(): RegExp;
|
|
58
58
|
//# sourceMappingURL=utils.d.ts.map
|
package/build/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAgB,KAAK,CAAE,IAAI,EAAE,YAAY,CAAC,mBAAmB,WAM5D;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAE,IAAI,EAAE,YAAY,CAAC,mBAAmB,WAM/D;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,gBAAgB,EAAE,MAAM,gBACtC,aAAa,mBAAmB,UAYvD;AAED,wBAAgB,SAAS,WAOxB"}
|
package/build/utils.js
CHANGED
|
@@ -62,25 +62,15 @@ export function isEmuSim(caps) {
|
|
|
62
62
|
* @param {object} options - Additional options to set on the capability
|
|
63
63
|
* @returns {function(object): void} - A function that mutates a single capability
|
|
64
64
|
*/
|
|
65
|
-
export function makeCapabilityFactory(tunnelIdentifier
|
|
65
|
+
export function makeCapabilityFactory(tunnelIdentifier) {
|
|
66
66
|
return (capability) => {
|
|
67
|
-
//
|
|
68
|
-
|
|
69
|
-
// is a mix of JWP and W3C. This is hard to check
|
|
70
|
-
const isW3CRequest = Boolean(Object.keys(capability).find((cap) => cap.includes(':')));
|
|
71
|
-
// If the `sauce:options` are not provided and it is a W3C session
|
|
72
|
-
// then add it
|
|
73
|
-
if (!capability['sauce:options'] && isW3CRequest) {
|
|
67
|
+
// If the `sauce:options` are not provided and it is a W3C session then add it
|
|
68
|
+
if (!capability['sauce:options']) {
|
|
74
69
|
capability['sauce:options'] = {};
|
|
75
70
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
sauceOptions.tunnelIdentifier = (capability.tunnelIdentifier ||
|
|
79
|
-
sauceOptions.tunnelIdentifier ||
|
|
71
|
+
capability['sauce:options'].tunnelIdentifier = (capability.tunnelIdentifier ||
|
|
72
|
+
capability['sauce:options'].tunnelIdentifier ||
|
|
80
73
|
tunnelIdentifier);
|
|
81
|
-
if (isW3CRequest) {
|
|
82
|
-
delete capability.tunnelIdentifier;
|
|
83
|
-
}
|
|
84
74
|
};
|
|
85
75
|
}
|
|
86
76
|
export function ansiRegex() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/sauce-service",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.7",
|
|
4
4
|
"description": "WebdriverIO service that provides a better integration into Sauce Labs",
|
|
5
5
|
"author": "Christian Bromann <mail@bromann.dev>",
|
|
6
6
|
"homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-sauce-service",
|
|
@@ -27,17 +27,16 @@
|
|
|
27
27
|
"types": "./build/index.d.ts",
|
|
28
28
|
"typeScriptVersion": "3.8.3",
|
|
29
29
|
"dependencies": {
|
|
30
|
+
"@types/ip": "^1.1.0",
|
|
30
31
|
"@wdio/logger": "8.0.0",
|
|
31
|
-
"@wdio/types": "8.0.
|
|
32
|
-
"@wdio/utils": "8.0.
|
|
32
|
+
"@wdio/types": "8.0.7",
|
|
33
|
+
"@wdio/utils": "8.0.7",
|
|
34
|
+
"ip": "^1.1.8",
|
|
33
35
|
"saucelabs": "^7.1.3",
|
|
34
36
|
"webdriverio": "8.0.2"
|
|
35
37
|
},
|
|
36
|
-
"devDependencies": {
|
|
37
|
-
"@types/node": "^18.0.0"
|
|
38
|
-
},
|
|
39
38
|
"publishConfig": {
|
|
40
39
|
"access": "public"
|
|
41
40
|
},
|
|
42
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "a874a82a727634d1323fff05c17455ba0907a020"
|
|
43
42
|
}
|