@wdio/sauce-service 8.3.3 → 8.3.8
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/README.md +8 -29
- package/build/launcher.d.ts.map +1 -1
- package/build/launcher.js +1 -0
- package/build/service.d.ts.map +1 -1
- package/build/service.js +9 -37
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
WebdriverIO Sauce Service
|
|
2
2
|
=========================
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
WebdriverIO service that provides a better integration into Sauce Labs. This service can be used for:
|
|
5
5
|
|
|
6
|
-
- the Sauce Labs
|
|
7
|
-
- the Sauce Labs Real Device cloud (iOS and Android)
|
|
6
|
+
- the Sauce Labs Virtual Machine Cloud (Desktop Web/Emulator/Simulator)
|
|
7
|
+
- the Sauce Labs Real Device cloud (iOS and Android)
|
|
8
|
+
|
|
9
|
+
It can update the job metadata ('name'*, 'passed', 'tags', 'public', 'build', 'custom-data') and runs Sauce Connect if desired.
|
|
8
10
|
|
|
9
11
|
What else will this service do for you:
|
|
10
12
|
|
|
@@ -26,11 +28,9 @@ Instructions on how to install `WebdriverIO` can be found [here.](https://webdri
|
|
|
26
28
|
|
|
27
29
|
## Configuration
|
|
28
30
|
|
|
29
|
-
To use the service for the
|
|
30
|
-
|
|
31
|
-
> NOTE: By default the `ondemand.us-west-1.saucelabs.com` US endpoint will be used. This is the new Unified Platform endpoint. If you want to use the *old* endpoint then don't provide a region and add `hostname: ondemand.saucelabs.com` to your configuration file.
|
|
31
|
+
To use the service for the Virtual Desktop/Emulator/Simulator Machine and Real Device cloud you need to set `user` and `key` in your `wdio.conf.js` file. It will automatically use Sauce Labs to run your integration tests. If you run your tests on Sauce Labs you can specify the region you want to run your tests in via the `region` property. Available short handles for regions are `us` (default), `eu` and `apac`. These regions are used for the Sauce Labs VM cloud and the Sauce Labs Real Device Cloud. If you don't provide the region, it defaults to `us`.
|
|
32
32
|
|
|
33
|
-
If you want WebdriverIO to automatically spin up a [Sauce Connect](https://wiki.saucelabs.com/display/DOCS/Sauce+Connect+Proxy) tunnel, you need to set `sauceConnect: true`. If you would like to change the data center to EU add `region:'eu'` or APAC add `region:'apac'` as US data center is set as default
|
|
33
|
+
If you want WebdriverIO to automatically spin up a [Sauce Connect](https://wiki.saucelabs.com/display/DOCS/Sauce+Connect+Proxy) tunnel, you need to set `sauceConnect: true`. If you would like to change the data center to EU add `region:'eu'` or APAC add `region:'apac'` as US data center is set as default.
|
|
34
34
|
|
|
35
35
|
```js
|
|
36
36
|
// wdio.conf.js
|
|
@@ -111,21 +111,6 @@ export const config = {
|
|
|
111
111
|
|
|
112
112
|
</TabItem>
|
|
113
113
|
</Tabs>
|
|
114
|
-
|
|
115
|
-
If you want to use the Real Device cloud pass the `testobject_api_key` in the capabilities like this:
|
|
116
|
-
|
|
117
|
-
```js
|
|
118
|
-
capabilities = [
|
|
119
|
-
{
|
|
120
|
-
deviceName: 'iPhone XS',
|
|
121
|
-
// The api key that has a reference to the app-project in the RDC cloud
|
|
122
|
-
testobject_api_key: process.env.SAUCE_RDC_ACCESS_KEY,
|
|
123
|
-
// Some default settings
|
|
124
|
-
// You can find more info in the TO Appium Basic Setup section
|
|
125
|
-
platformName: 'iOS',
|
|
126
|
-
platformVersion: '11.4'
|
|
127
|
-
},
|
|
128
|
-
]
|
|
129
114
|
```
|
|
130
115
|
|
|
131
116
|
## Sauce Service Options
|
|
@@ -138,16 +123,12 @@ This service will automatically push the error stack to Sauce Labs when a test f
|
|
|
138
123
|
Type: `number`<br />
|
|
139
124
|
Default: `5`
|
|
140
125
|
|
|
141
|
-
*(only for vm and or em/simulators)*
|
|
142
|
-
|
|
143
126
|
### sauceConnect
|
|
144
|
-
If true it runs Sauce Connect and opens a secure connection between a Sauce Labs virtual machine running your browser tests.
|
|
127
|
+
If `true` it runs Sauce Connect and opens a secure connection between a Sauce Labs virtual machine running your browser tests.
|
|
145
128
|
|
|
146
129
|
Type: `Boolean`<br />
|
|
147
130
|
Default: `false`
|
|
148
131
|
|
|
149
|
-
*(only for vm and or em/simulators)*
|
|
150
|
-
|
|
151
132
|
### sauceConnectOpts
|
|
152
133
|
Apply Sauce Connect options (e.g. to change port number or logFile settings). See [this list](https://wiki.saucelabs.com/display/DOCS/Sauce+Connect+Proxy+Command-Line+Quick+Reference+Guide) for more information. Per default, the service disables SC proxy auto-detection via `noAutodetect`` as this can be unreliable for some machines.
|
|
153
134
|
|
|
@@ -156,8 +137,6 @@ NOTE: When specifying the options the `--` should be omitted. It can also be tur
|
|
|
156
137
|
Type: `Object`<br />
|
|
157
138
|
Default: `{ noAutodetect: true }`
|
|
158
139
|
|
|
159
|
-
*(only for vm and or em/simulators)*
|
|
160
|
-
|
|
161
140
|
### uploadLogs
|
|
162
141
|
|
|
163
142
|
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.
|
package/build/launcher.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launcher.d.ts","sourceRoot":"","sources":["../src/launcher.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAoB,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAA;AAG5F,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAGlE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAMpD,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,
|
|
1
|
+
{"version":3,"file":"launcher.d.ts","sourceRoot":"","sources":["../src/launcher.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAoB,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAA;AAG5F,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAGlE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAMpD,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
|
@@ -16,6 +16,7 @@ export default class SauceLauncher {
|
|
|
16
16
|
this._options = _options;
|
|
17
17
|
this._capabilities = _capabilities;
|
|
18
18
|
this._config = _config;
|
|
19
|
+
// @ts-expect-error https://github.com/saucelabs/node-saucelabs/issues/153
|
|
19
20
|
this._api = new SauceLabs.default(this._config);
|
|
20
21
|
}
|
|
21
22
|
/**
|
package/build/service.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAoB,GAAG,EAAE,MAAM,WAAW,CAAA;AAGtD,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,a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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;YAezB,WAAW;CAe5B"}
|
package/build/service.js
CHANGED
|
@@ -25,6 +25,7 @@ export default class SauceService {
|
|
|
25
25
|
this._capabilities = _capabilities;
|
|
26
26
|
this._config = _config;
|
|
27
27
|
this._options = { ...DEFAULT_OPTIONS, ...options };
|
|
28
|
+
// @ts-expect-error https://github.com/saucelabs/node-saucelabs/issues/153
|
|
28
29
|
this._api = new SauceLabs.default(this._config);
|
|
29
30
|
this._maxErrorStackLength = this._options.maxErrorStackLength || this._maxErrorStackLength;
|
|
30
31
|
}
|
|
@@ -73,7 +74,7 @@ export default class SauceService {
|
|
|
73
74
|
* Don't do this for Jasmine because `suite.title` is `Jasmine__TopLevel__Suite`
|
|
74
75
|
* and `suite.fullTitle` is `undefined`, so no alternative to use for the job name.
|
|
75
76
|
*/
|
|
76
|
-
if (this._browser && !this.
|
|
77
|
+
if (this._browser && !this._isJobNameSet && this._suiteTitle !== 'Jasmine__TopLevel__Suite') {
|
|
77
78
|
await this._setJobName(this._suiteTitle);
|
|
78
79
|
}
|
|
79
80
|
}
|
|
@@ -93,13 +94,6 @@ export default class SauceService {
|
|
|
93
94
|
if (this._browser && !this._isJobNameSet) {
|
|
94
95
|
await this._setJobName(this._suiteTitle);
|
|
95
96
|
}
|
|
96
|
-
/**
|
|
97
|
-
* Date: 20200714
|
|
98
|
-
* Remark: Sauce Unified Platform doesn't support updating the context yet.
|
|
99
|
-
*/
|
|
100
|
-
if (this._isRDC) {
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
97
|
const fullTitle = (
|
|
104
98
|
/**
|
|
105
99
|
* Jasmine
|
|
@@ -123,10 +117,8 @@ export default class SauceService {
|
|
|
123
117
|
afterTest(test, context, results) {
|
|
124
118
|
/**
|
|
125
119
|
* If the test failed push the stack to Sauce Labs in separate lines
|
|
126
|
-
* This should not be done for UP because it's not supported yet and
|
|
127
|
-
* should be removed when UP supports `sauce:context`
|
|
128
120
|
*/
|
|
129
|
-
if (results.error && results.error.stack
|
|
121
|
+
if (results.error && results.error.stack) {
|
|
130
122
|
this._reportErrorLog(results.error);
|
|
131
123
|
}
|
|
132
124
|
/**
|
|
@@ -156,10 +148,8 @@ export default class SauceService {
|
|
|
156
148
|
afterHook(test, context, results) {
|
|
157
149
|
/**
|
|
158
150
|
* If the test failed push the stack to Sauce Labs in separate lines
|
|
159
|
-
* This should not be done for UP because it's not supported yet and
|
|
160
|
-
* should be removed when UP supports `sauce:context`
|
|
161
151
|
*/
|
|
162
|
-
if (results.error
|
|
152
|
+
if (results.error) {
|
|
163
153
|
this._reportErrorLog(results.error);
|
|
164
154
|
}
|
|
165
155
|
if (!results.passed) {
|
|
@@ -177,13 +167,6 @@ export default class SauceService {
|
|
|
177
167
|
if (this._browser && !this._isJobNameSet) {
|
|
178
168
|
await this._setJobName(this._suiteTitle);
|
|
179
169
|
}
|
|
180
|
-
/**
|
|
181
|
-
* Date: 20200714
|
|
182
|
-
* Remark: Sauce Unified Platform doesn't support updating the context yet.
|
|
183
|
-
*/
|
|
184
|
-
if (this._isRDC) {
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
170
|
return this.setAnnotation(`sauce:context=Feature: ${this._suiteTitle}`);
|
|
188
171
|
}
|
|
189
172
|
/**
|
|
@@ -191,21 +174,14 @@ export default class SauceService {
|
|
|
191
174
|
* @param world world object containing information on pickle and test step
|
|
192
175
|
*/
|
|
193
176
|
beforeScenario(world) {
|
|
194
|
-
|
|
195
|
-
* Date: 20200714
|
|
196
|
-
* Remark: Sauce Unified Platform doesn't support updating the context yet.
|
|
197
|
-
*/
|
|
198
|
-
if (!this._isServiceEnabled || this._isRDC || !this._browser) {
|
|
177
|
+
if (!this._isServiceEnabled || !this._browser) {
|
|
199
178
|
return;
|
|
200
179
|
}
|
|
201
180
|
const scenarioName = world.pickle.name || 'unknown scenario';
|
|
202
181
|
return this.setAnnotation(`sauce:context=-Scenario: ${scenarioName}`);
|
|
203
182
|
}
|
|
204
183
|
async beforeStep(step) {
|
|
205
|
-
|
|
206
|
-
* Remark: Sauce Unified Platform doesn't support updating the context yet.
|
|
207
|
-
*/
|
|
208
|
-
if (!this._isServiceEnabled || this._isRDC || !this._browser) {
|
|
184
|
+
if (!this._isServiceEnabled || !this._browser) {
|
|
209
185
|
return;
|
|
210
186
|
}
|
|
211
187
|
const { keyword, text } = step;
|
|
@@ -252,12 +228,11 @@ export default class SauceService {
|
|
|
252
228
|
const multiRemoteBrowser = this._browser.getInstance(browserName);
|
|
253
229
|
const isMultiRemoteRDC = isRDC(multiRemoteBrowser.capabilities);
|
|
254
230
|
log.info(`Update multiRemote job for browser "${browserName}" and sessionId ${multiRemoteBrowser.sessionId}, ${status}`);
|
|
231
|
+
await this._uploadLogs(multiRemoteBrowser.sessionId);
|
|
255
232
|
// Sauce Unified Platform (RDC) can not be updated with an API.
|
|
256
|
-
// The logs can also not be uploaded
|
|
257
233
|
if (isMultiRemoteRDC) {
|
|
258
234
|
return this.setAnnotation(`sauce:job-result=${failures === 0}`);
|
|
259
235
|
}
|
|
260
|
-
await this._uploadLogs(multiRemoteBrowser.sessionId);
|
|
261
236
|
return this.updateJob(multiRemoteBrowser.sessionId, failures, false, browserName);
|
|
262
237
|
}));
|
|
263
238
|
}
|
|
@@ -338,12 +313,9 @@ export default class SauceService {
|
|
|
338
313
|
return;
|
|
339
314
|
}
|
|
340
315
|
if (this._browser.isMultiremote) {
|
|
341
|
-
const multiRemoteBrowser = this._browser;
|
|
342
316
|
return Promise.all(Object.keys(this._capabilities).map(async (browserName) => {
|
|
343
|
-
const
|
|
344
|
-
|
|
345
|
-
return this._browser.execute(annotation);
|
|
346
|
-
}
|
|
317
|
+
const multiRemoteBrowser = this._browser.getInstance(browserName);
|
|
318
|
+
return multiRemoteBrowser.execute(annotation);
|
|
347
319
|
}));
|
|
348
320
|
}
|
|
349
321
|
return this._browser.execute(annotation);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/sauce-service",
|
|
3
|
-
"version": "8.3.
|
|
3
|
+
"version": "8.3.8",
|
|
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",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@wdio/utils": "8.3.0",
|
|
33
33
|
"ip": "^1.1.8",
|
|
34
34
|
"saucelabs": "^7.1.3",
|
|
35
|
-
"webdriverio": "8.3.
|
|
35
|
+
"webdriverio": "8.3.8"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/ip": "^1.1.0"
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "a32ecf2abb9202d532fb98b7c23ceed9dbb2f6ee"
|
|
44
44
|
}
|