@wdio/browserstack-service 8.8.6 → 8.8.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/build/insights-handler.d.ts.map +1 -1
- package/build/insights-handler.js +42 -2
- package/build/util.d.ts.map +1 -1
- package/build/util.js +10 -5
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insights-handler.d.ts","sourceRoot":"","sources":["../src/insights-handler.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAgB,UAAU,EAAE,MAAM,aAAa,CAAA;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAGzE,OAAO,KAAK,EAAE,MAAM,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAOzE,MAAM,CAAC,OAAO,OAAO,eAAe;IASnB,OAAO,CAAC,QAAQ;IAAiF,OAAO,CAAC,UAAU,CAAC;IARjI,OAAO,CAAC,MAAM,CAA+B;IAC7C,OAAO,CAAC,MAAM,CAA+B;IAC7C,OAAO,CAAC,aAAa,CAAc;IACnC,OAAO,CAAC,SAAS,CAA2D;IAC5E,OAAO,CAAC,cAAc,CAAC,CAAQ;IAC/B,OAAO,CAAC,UAAU,CAAC,CAAQ;IAC3B,OAAO,CAAC,oBAAoB,CAAoC;gBAE3C,QAAQ,EAAE,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,kBAAkB,EAAE,aAAa,CAAC,EAAE,OAAO,EAAU,UAAU,CAAC,oBAAQ;IAezI,YAAY,CAAC,QAAQ,EAAE,MAAM;IAIvB,MAAM;IAiBN,UAAU,CAAE,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG;IAgB/C,SAAS,CAAE,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,UAAU;
|
|
1
|
+
{"version":3,"file":"insights-handler.d.ts","sourceRoot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,EAAE,UAAU,CAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,YAAY;IA0BzF,aAAa,CACf,WAAW,SAA2C,EACtD,YAAY,SAA4C,GACzD,OAAO,CAAC,OAAO,CAAC;IASb,QAAQ;IAId;;OAEG;IACG,cAAc,CAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,GAAG,gBAAgB,EAAE,IAAI,CAAC,EAAE,UAAU,CAAC,IAAI,GAAG,sBAAsB;IA2DtI,OAAO,CAAC,cAAc;IActB,OAAO,CAAC,YAAY;YAiBN,gBAAgB;YA6EhB,2BAA2B;IAmFzC,OAAO,CAAC,qBAAqB;IAW7B,OAAO,CAAC,aAAa;CAMxB"}
|
|
@@ -73,6 +73,41 @@ export default class InsightsHandler {
|
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
75
|
await this.sendTestRunEvent(test, 'HookRunFinished', result);
|
|
76
|
+
if (this._framework !== 'mocha') {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const hookType = getHookType(test.title);
|
|
80
|
+
/*
|
|
81
|
+
If any of the `beforeAll`, `beforeEach`, `afterEach` then the tests after the hook won't run in mocha (https://github.com/mochajs/mocha/issues/4392)
|
|
82
|
+
So if any of this hook fails, then we are sending the next tests in the suite as skipped.
|
|
83
|
+
This won't be needed for `afterAll`, as even if `afterAll` fails all the tests that we need are already run by then, so we don't need to send the stats for them separately
|
|
84
|
+
*/
|
|
85
|
+
if (!result.passed && (hookType === 'BEFORE_EACH' || hookType === 'BEFORE_ALL' || hookType === 'AFTER_EACH')) {
|
|
86
|
+
const sendTestSkip = async (skippedTest) => {
|
|
87
|
+
// We only need to send the tests that whose state is not determined yet. The state of tests which is determined will already be sent.
|
|
88
|
+
if (skippedTest.state === undefined) {
|
|
89
|
+
const fullTitle = `${skippedTest.parent.title} - ${skippedTest.title}`;
|
|
90
|
+
this._tests[fullTitle] = {
|
|
91
|
+
uuid: uuidv4(),
|
|
92
|
+
startedAt: (new Date()).toISOString(),
|
|
93
|
+
finishedAt: (new Date()).toISOString()
|
|
94
|
+
};
|
|
95
|
+
await this.sendTestRunEvent(skippedTest, 'TestRunSkipped');
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
/*
|
|
99
|
+
Recursively send the tests as skipped for all suites below the hook. This is to handle nested describe blocks
|
|
100
|
+
*/
|
|
101
|
+
const sendSuiteSkipped = async (suite) => {
|
|
102
|
+
for (const skippedTest of suite.tests) {
|
|
103
|
+
await sendTestSkip(skippedTest);
|
|
104
|
+
}
|
|
105
|
+
for (const skippedSuite of suite.suites) {
|
|
106
|
+
await sendSuiteSkipped(skippedSuite);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
await sendSuiteSkipped(test.ctx.test.parent);
|
|
110
|
+
}
|
|
76
111
|
}
|
|
77
112
|
async beforeTest(test) {
|
|
78
113
|
const fullTitle = getUniqueIdentifier(test, this._framework);
|
|
@@ -237,7 +272,8 @@ export default class InsightsHandler {
|
|
|
237
272
|
getHierarchy(test) {
|
|
238
273
|
const value = [];
|
|
239
274
|
if (test.ctx && test.ctx.test) {
|
|
240
|
-
|
|
275
|
+
// If we already have the parent object, utilize it else get from context
|
|
276
|
+
let parent = typeof test.parent === 'object' ? test.parent : test.ctx.test.parent;
|
|
241
277
|
while (parent && parent.title !== '') {
|
|
242
278
|
value.push(parent.title);
|
|
243
279
|
parent = parent.parent;
|
|
@@ -292,13 +328,17 @@ export default class InsightsHandler {
|
|
|
292
328
|
testData.hooks = this._hooks[fullTitle];
|
|
293
329
|
}
|
|
294
330
|
}
|
|
295
|
-
if (eventType === 'TestRunStarted') {
|
|
331
|
+
if (eventType === 'TestRunStarted' || eventType === 'TestRunSkipped') {
|
|
296
332
|
testData.integrations = {};
|
|
297
333
|
if (this._browser && this._platformMeta) {
|
|
298
334
|
const provider = getCloudProvider(this._browser);
|
|
299
335
|
testData.integrations[provider] = this.getIntegrationsObject();
|
|
300
336
|
}
|
|
301
337
|
}
|
|
338
|
+
if (eventType === 'TestRunSkipped') {
|
|
339
|
+
testData.result = 'skipped';
|
|
340
|
+
eventType = 'TestRunFinished';
|
|
341
|
+
}
|
|
302
342
|
const uploadData = {
|
|
303
343
|
event_type: eventType,
|
|
304
344
|
};
|
package/build/util.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAQzE,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAkB,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAC5F,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAkBjE;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,YAAY,CAAC,mBAAmB,UAa1E;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,kBAAkB,EAAE,IAAI,CAAC,EAAE,YAAY,CAAC,gBAAgB,EAAE,WAAW,CAAC,EAAE,MAAM,6BAS/J;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,CAAC,EAAE,YAAY,CAAC,YAAY,WAWvE;AAED,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM,CAUpF;AAED,wBAAsB,iBAAiB,CAAE,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,UAAU,EAAE,QAAQ,EAAE,UAAU,iBAgE1I;AAED,wBAAsB,iBAAiB;;;eAqCtC;AAED,wBAAgB,SAAS;;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C,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,UAAU,sBAQhH;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,UAAU,sBAQ/G;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,UAAU,EAAE,iBAAiB,CAAC,EAAE,MAAM,sBAQnH;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,UAAU,EAAE,eAAe,CAAC,EAAE,MAAM,UAQ/G;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,UAAU,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAW7H;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,WAUrE;AAED,eAAO,MAAM,KAAK,mCAAkE,CAAA"}
|
package/build/util.js
CHANGED
|
@@ -306,7 +306,12 @@ export function getUniqueIdentifier(test, framework) {
|
|
|
306
306
|
if (framework === 'jasmine') {
|
|
307
307
|
return test.fullName;
|
|
308
308
|
}
|
|
309
|
-
|
|
309
|
+
let parentTitle = test.parent;
|
|
310
|
+
// Sometimes parent will be an object instead of a string
|
|
311
|
+
if (typeof parentTitle === 'object') {
|
|
312
|
+
parentTitle = parentTitle.title;
|
|
313
|
+
}
|
|
314
|
+
return `${parentTitle} - ${test.title}`;
|
|
310
315
|
}
|
|
311
316
|
export function getUniqueIdentifierForCucumber(world) {
|
|
312
317
|
return world.pickle.uri + '_' + world.pickle.astNodeIds.join(',');
|
|
@@ -420,16 +425,16 @@ export function getHierarchy(fullTitle) {
|
|
|
420
425
|
return fullTitle.split('.').slice(0, -1);
|
|
421
426
|
}
|
|
422
427
|
export function getHookType(hookName) {
|
|
423
|
-
if (hookName.
|
|
428
|
+
if (hookName.startsWith('"before each"')) {
|
|
424
429
|
return 'BEFORE_EACH';
|
|
425
430
|
}
|
|
426
|
-
else if (hookName.
|
|
431
|
+
else if (hookName.startsWith('"before all"')) {
|
|
427
432
|
return 'BEFORE_ALL';
|
|
428
433
|
}
|
|
429
|
-
else if (hookName.
|
|
434
|
+
else if (hookName.startsWith('"after each"')) {
|
|
430
435
|
return 'AFTER_EACH';
|
|
431
436
|
}
|
|
432
|
-
else if (hookName.
|
|
437
|
+
else if (hookName.startsWith('"after all"')) {
|
|
433
438
|
return 'AFTER_ALL';
|
|
434
439
|
}
|
|
435
440
|
return 'unknown';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/browserstack-service",
|
|
3
|
-
"version": "8.8.
|
|
3
|
+
"version": "8.8.8",
|
|
4
4
|
"description": "WebdriverIO service for better Browserstack integration",
|
|
5
5
|
"author": "Adam Bjerstedt <abjerstedt@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-browserstack-service",
|
|
@@ -32,15 +32,15 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@types/gitconfiglocal": "^2.0.1",
|
|
34
34
|
"@wdio/logger": "8.6.6",
|
|
35
|
-
"@wdio/reporter": "8.8.
|
|
36
|
-
"@wdio/types": "8.8.
|
|
35
|
+
"@wdio/reporter": "8.8.7",
|
|
36
|
+
"@wdio/types": "8.8.7",
|
|
37
37
|
"browserstack-local": "^1.5.1",
|
|
38
38
|
"form-data": "^4.0.0",
|
|
39
39
|
"git-repo-info": "^2.1.1",
|
|
40
40
|
"gitconfiglocal": "^2.1.0",
|
|
41
41
|
"got": "^12.1.0",
|
|
42
42
|
"uuid": "^8.3.2",
|
|
43
|
-
"webdriverio": "8.8.
|
|
43
|
+
"webdriverio": "8.8.8"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"@wdio/cli": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0"
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"publishConfig": {
|
|
52
52
|
"access": "public"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "55b68685242f5f5288198649698435629e7b4cb9"
|
|
55
55
|
}
|