@wdio/sauce-service 7.26.0 → 7.28.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.
@@ -34,11 +34,14 @@ export default class SauceService implements Services.ServiceInstance {
34
34
  beforeFeature(uri: unknown, feature: {
35
35
  name: string;
36
36
  }): Promise<unknown>;
37
+ /**
38
+ * Runs before a Cucumber Scenario.
39
+ * @param world world object containing information on pickle and test step
40
+ */
37
41
  beforeScenario(world: Frameworks.World): Promise<unknown> | undefined;
38
42
  beforeStep(step: Frameworks.PickleStep): Promise<unknown>;
39
43
  /**
40
- *
41
- * Runs before a Cucumber Scenario.
44
+ * Runs after a Cucumber Scenario.
42
45
  * @param world world object containing information on pickle and test step
43
46
  * @param result result object containing
44
47
  * @param result.passed true if scenario has passed
@@ -66,5 +69,6 @@ export default class SauceService implements Services.ServiceInstance {
66
69
  * Update the running Sauce Labs Job with an annotation
67
70
  */
68
71
  setAnnotation(annotation: string): Promise<unknown>;
72
+ private _setJobName;
69
73
  }
70
74
  //# sourceMappingURL=service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAGA,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;AAG9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAO5C,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,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,CAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM;IAmB9C,SAAS,CAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,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
@@ -58,14 +58,14 @@ class SauceService {
58
58
  async beforeSuite(suite) {
59
59
  this._suiteTitle = suite.title;
60
60
  /**
61
- * Make sure we account for the cases where there is a long running `before` function for a
62
- * suite or one that can fail so we set the default job name at the suite level
63
- * Don't do this for Jasmine because the `suiteTitle` is `Jasmine__TopLevel__Suite` and the
64
- * `fullName` is `null`, so no alternative
65
- **/
61
+ * Set the default job name at the suite level to make sure we account
62
+ * for the cases where there is a long running `before` function for a
63
+ * suite or one that can fail.
64
+ * Don't do this for Jasmine because `suite.title` is `Jasmine__TopLevel__Suite`
65
+ * and `suite.fullTitle` is `undefined`, so no alternative to use for the job name.
66
+ */
66
67
  if (this._browser && !this._isRDC && !this._isJobNameSet && this._suiteTitle !== 'Jasmine__TopLevel__Suite') {
67
- await this.setAnnotation('sauce:job-name=' + this._suiteTitle);
68
- this._isJobNameSet = true;
68
+ await this._setJobName(this._suiteTitle);
69
69
  }
70
70
  }
71
71
  async beforeTest(test) {
@@ -82,16 +82,7 @@ class SauceService {
82
82
  this._suiteTitle = test.fullName.slice(0, test.fullName.indexOf(test.description || '') - 1);
83
83
  }
84
84
  if (this._browser && !this._isJobNameSet) {
85
- let jobName = this._suiteTitle;
86
- if (this._options.setJobName) {
87
- jobName = this._options.setJobName(this._config, this._capabilities, this._suiteTitle);
88
- await this.setAnnotation(`sauce:job-name=${jobName}`);
89
- this._isJobNameSet = true;
90
- }
91
- if (!this._isJobNameSet) {
92
- await this.setAnnotation(`sauce:job-name=${jobName}`);
93
- this._isJobNameSet = true;
94
- }
85
+ await this._setJobName(this._suiteTitle);
95
86
  }
96
87
  /**
97
88
  * Date: 20200714
@@ -175,8 +166,7 @@ class SauceService {
175
166
  }
176
167
  this._suiteTitle = feature.name;
177
168
  if (this._browser && !this._isJobNameSet) {
178
- await this.setAnnotation(`sauce:job-name=${this._suiteTitle}`);
179
- this._isJobNameSet = true;
169
+ await this._setJobName(this._suiteTitle);
180
170
  }
181
171
  /**
182
172
  * Date: 20200714
@@ -187,6 +177,10 @@ class SauceService {
187
177
  }
188
178
  return this.setAnnotation(`sauce:context=Feature: ${this._suiteTitle}`);
189
179
  }
180
+ /**
181
+ * Runs before a Cucumber Scenario.
182
+ * @param world world object containing information on pickle and test step
183
+ */
190
184
  beforeScenario(world) {
191
185
  /**
192
186
  * Date: 20200714
@@ -209,8 +203,7 @@ class SauceService {
209
203
  return this.setAnnotation(`sauce:context=--Step: ${keyword}${text}`);
210
204
  }
211
205
  /**
212
- *
213
- * Runs before a Cucumber Scenario.
206
+ * Runs after a Cucumber Scenario.
214
207
  * @param world world object containing information on pickle and test step
215
208
  * @param result result object containing
216
209
  * @param result.passed true if scenario has passed
@@ -346,5 +339,15 @@ class SauceService {
346
339
  }
347
340
  return this._browser.execute(annotation);
348
341
  }
342
+ async _setJobName(suiteTitle) {
343
+ if (!suiteTitle)
344
+ return;
345
+ let jobName = suiteTitle;
346
+ if (this._options.setJobName) {
347
+ jobName = this._options.setJobName(this._config, this._capabilities, suiteTitle);
348
+ }
349
+ await this.setAnnotation(`sauce:job-name=${jobName}`);
350
+ this._isJobNameSet = true;
351
+ }
349
352
  }
350
353
  exports.default = SauceService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wdio/sauce-service",
3
- "version": "7.26.0",
3
+ "version": "7.28.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",
@@ -28,7 +28,7 @@
28
28
  "@wdio/types": "7.26.0",
29
29
  "@wdio/utils": "7.26.0",
30
30
  "saucelabs": "^7.1.3",
31
- "webdriverio": "7.26.0"
31
+ "webdriverio": "7.28.0"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "@wdio/cli": "^7.0.0"
@@ -37,5 +37,5 @@
37
37
  "access": "public"
38
38
  },
39
39
  "types": "./build/index.d.ts",
40
- "gitHead": "573927a79dc0a2b9d9a9e19e7d1b8c1ff9fac308"
40
+ "gitHead": "09be73a21a3241d65c92269ff2ca7cec2d49b5fc"
41
41
  }