@wdio/sauce-service 10.0.0-alpha.18 → 10.0.0
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/AGENTS.md +17 -0
- package/README.md +17 -11
- package/build/index.js +5 -5
- package/build/utils.d.ts +0 -6
- package/build/utils.d.ts.map +1 -1
- package/package.json +9 -9
package/AGENTS.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# @wdio/sauce-service
|
|
2
|
+
|
|
3
|
+
Package-specific notes. Shared package rules live in [../AGENTS.md](../AGENTS.md).
|
|
4
|
+
|
|
5
|
+
## Tests
|
|
6
|
+
|
|
7
|
+
Owners:
|
|
8
|
+
|
|
9
|
+
- Sauce Connect launch, tunnel name, and retries: `tests/launcher.test.ts` against `src/launcher.ts`.
|
|
10
|
+
- Worker hooks, job updates, and annotations: `tests/service.test.ts` against `src/service.ts`.
|
|
11
|
+
- Real device versus emulator or simulator: `isRDC` in `src/utils.ts`, covered by `tests/utils.test.ts`.
|
|
12
|
+
|
|
13
|
+
Classify sessions with `isRDC` only. Tunnel setup stopped consulting a separate emulator helper when Sauce Connect moved to W3C options.
|
|
14
|
+
|
|
15
|
+
`onPrepare` leaves `hostname`, `port`, and `protocol` alone. Sauce Connect 5 removed the Selenium relay (`scRelay`).
|
|
16
|
+
|
|
17
|
+
Keep a single `getBody` test for job body shape. Name each test after the hook it calls.
|
package/README.md
CHANGED
|
@@ -117,41 +117,45 @@ To authorize the Sauce Labs service your config needs to contain a [`user`](http
|
|
|
117
117
|
|
|
118
118
|
### maxErrorStackLength
|
|
119
119
|
|
|
120
|
+
<Option type="number" default="5">
|
|
121
|
+
|
|
120
122
|
This service will automatically push the error stack to Sauce Labs when a test fails. By default, it will only push the first 5 lines, but if needed this can be changed. Be aware that more lines will result in more WebDriver calls which might slow down the execution.
|
|
121
123
|
|
|
122
|
-
|
|
123
|
-
Default: `5`
|
|
124
|
+
</Option>
|
|
124
125
|
|
|
125
126
|
### sauceConnect
|
|
126
127
|
|
|
128
|
+
<Option type="Boolean" default="false">
|
|
129
|
+
|
|
127
130
|
If `true` it runs Sauce Connect and opens a secure connection between a Sauce Labs virtual machine running your browser tests.
|
|
128
131
|
|
|
129
|
-
|
|
130
|
-
Default: `false`
|
|
132
|
+
</Option>
|
|
131
133
|
|
|
132
134
|
### sauceConnectOpts
|
|
133
135
|
|
|
136
|
+
<Option type="Object" default={`{ }`}>
|
|
137
|
+
|
|
134
138
|
Apply Sauce Connect options (e.g. to change port number or logFile settings). See [this list](https://docs.saucelabs.com/dev/cli/sauce-connect-5/run/) for more information.
|
|
135
139
|
|
|
136
140
|
NOTE: When specifying the options the `--` should be omitted. It can also be turned into camelCase (e.g. `shared-tunnel` or `sharedTunnel`).
|
|
137
141
|
|
|
138
|
-
|
|
139
|
-
Default: `{ }`
|
|
142
|
+
</Option>
|
|
140
143
|
|
|
141
144
|
### uploadLogs
|
|
142
145
|
|
|
146
|
+
<Option type="Boolean" default="true">
|
|
147
|
+
|
|
143
148
|
If `true` this option uploads all WebdriverIO log files to the Sauce Labs platform for further inspection. Make sure you have [`outputDir`](https://webdriver.io/docs/options#outputdir) set in your wdio config to write logs into files, otherwise data will be streamed to stdout and can't get uploaded.
|
|
144
149
|
|
|
145
|
-
|
|
146
|
-
Default: `true`
|
|
150
|
+
</Option>
|
|
147
151
|
|
|
148
152
|
### setJobName
|
|
149
153
|
|
|
150
|
-
|
|
154
|
+
<Option type="Function" default="(config, capabilities, suiteTitle) => suiteTitle">
|
|
151
155
|
|
|
152
|
-
|
|
153
|
-
Default: `(config, capabilities, suiteTitle) => suiteTitle`
|
|
156
|
+
Allows users to dynamically set the job name based on worker parameters such as WebdriverIO configuration, used capabilities and the original suite title.
|
|
154
157
|
|
|
158
|
+
</Option>
|
|
155
159
|
----
|
|
156
160
|
|
|
157
161
|
## Overriding generated name metadata
|
|
@@ -163,3 +167,5 @@ You can override this by providing a value for the `name` desired capability, bu
|
|
|
163
167
|
----
|
|
164
168
|
|
|
165
169
|
For more information on WebdriverIO see the [homepage](https://webdriver.io).
|
|
170
|
+
|
|
171
|
+
|
package/build/index.js
CHANGED
|
@@ -365,7 +365,7 @@ var SauceService = class {
|
|
|
365
365
|
failures = 1;
|
|
366
366
|
}
|
|
367
367
|
const status = "status: " + (failures > 0 ? "failing" : "passing");
|
|
368
|
-
if (!this._browser.
|
|
368
|
+
if (!this._browser.isMultiRemote) {
|
|
369
369
|
await this._uploadLogs(this._browser.sessionId);
|
|
370
370
|
this._updateJobIdInTestRuns(this._browser.sessionId);
|
|
371
371
|
try {
|
|
@@ -414,7 +414,7 @@ var SauceService = class {
|
|
|
414
414
|
return;
|
|
415
415
|
}
|
|
416
416
|
const status = "status: " + (this._failures > 0 ? "failing" : "passing");
|
|
417
|
-
if (!this._browser.
|
|
417
|
+
if (!this._browser.isMultiRemote) {
|
|
418
418
|
log2.info(`Update (reloaded) job with sessionId ${oldSessionId}, ${status}`);
|
|
419
419
|
return this.updateJob(oldSessionId, this._failures, true);
|
|
420
420
|
}
|
|
@@ -422,7 +422,7 @@ var SauceService = class {
|
|
|
422
422
|
const browserName = mulitremoteBrowser.instances.filter(
|
|
423
423
|
(browserName2) => mulitremoteBrowser.getInstance(browserName2).sessionId === newSessionId
|
|
424
424
|
)[0];
|
|
425
|
-
log2.info(`Update (reloaded)
|
|
425
|
+
log2.info(`Update (reloaded) multi-remote job for browser "${browserName}" and sessionId ${oldSessionId}, ${status}`);
|
|
426
426
|
return this.updateJob(oldSessionId, this._failures, true, browserName);
|
|
427
427
|
}
|
|
428
428
|
async updateJob(sessionId, failures, calledOnReload = false, browserName) {
|
|
@@ -442,7 +442,7 @@ var SauceService = class {
|
|
|
442
442
|
}
|
|
443
443
|
let testCnt = ++this._testCnt;
|
|
444
444
|
const mulitremoteBrowser = this._browser;
|
|
445
|
-
if (this._browser && this._browser.
|
|
445
|
+
if (this._browser && this._browser.isMultiRemote) {
|
|
446
446
|
testCnt = Math.ceil(testCnt / mulitremoteBrowser.instances.length);
|
|
447
447
|
}
|
|
448
448
|
body.name += ` (${testCnt})`;
|
|
@@ -471,7 +471,7 @@ var SauceService = class {
|
|
|
471
471
|
if (!this._browser) {
|
|
472
472
|
return;
|
|
473
473
|
}
|
|
474
|
-
if (this._browser.
|
|
474
|
+
if (this._browser.isMultiRemote) {
|
|
475
475
|
return Promise.all(Object.keys(this._capabilities).map(async (browserName) => {
|
|
476
476
|
const multiRemoteBrowser = this._browser.getInstance(browserName);
|
|
477
477
|
return multiRemoteBrowser.executeScript(annotation, []);
|
package/build/utils.d.ts
CHANGED
|
@@ -41,12 +41,6 @@
|
|
|
41
41
|
* }
|
|
42
42
|
*/
|
|
43
43
|
export declare function isRDC(caps: WebdriverIO.Capabilities): boolean;
|
|
44
|
-
/**
|
|
45
|
-
* Determine if this is an EMUSIM session
|
|
46
|
-
* @param {object} caps
|
|
47
|
-
* @returns {boolean}
|
|
48
|
-
*/
|
|
49
|
-
export declare function isEmuSim(caps: WebdriverIO.Capabilities): boolean;
|
|
50
44
|
/** Ensure capabilities are in the correct format for Sauce Labs
|
|
51
45
|
* @param {string} tunnelName - The default Sauce Connect tunnel identifier
|
|
52
46
|
* @param {object} options - Additional options to set on the capability
|
package/build/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,WAAW,CAAC,YAAY,WAMnD;AAED;;;;GAIG;AACH,wBAAgB,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,WAAW,CAAC,YAAY,WAMnD;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,IAC5C,YAAY,WAAW,CAAC,YAAY,UAQ/C;AAED,wBAAgB,SAAS,WAOxB"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/sauce-service",
|
|
3
|
-
"version": "10.0.0
|
|
3
|
+
"version": "10.0.0",
|
|
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",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"engines": {
|
|
9
|
-
"node": ">=
|
|
9
|
+
"node": ">=22.19.0"
|
|
10
10
|
},
|
|
11
11
|
"repository": {
|
|
12
12
|
"type": "git",
|
|
@@ -30,20 +30,20 @@
|
|
|
30
30
|
"import": "./build/index.js"
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
|
-
"typeScriptVersion": "
|
|
33
|
+
"typeScriptVersion": "6.0.3",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@wdio/logger": "
|
|
36
|
-
"@wdio/types": "
|
|
37
|
-
"@wdio/utils": "
|
|
35
|
+
"@wdio/logger": "10.0.0",
|
|
36
|
+
"@wdio/types": "10.0.0",
|
|
37
|
+
"@wdio/utils": "10.0.0",
|
|
38
38
|
"saucelabs": "^9.0.1",
|
|
39
|
-
"webdriverio": "
|
|
39
|
+
"webdriverio": "10.0.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/ip": "^1.1.0",
|
|
43
|
-
"@wdio/globals": "10.0.0
|
|
43
|
+
"@wdio/globals": "10.0.0"
|
|
44
44
|
},
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"access": "public"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "38bd5ff4dccfaadccce4bd678286f00594623da2"
|
|
49
49
|
}
|