@wdio/browserstack-service 7.27.0 → 7.28.1
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/service.d.ts +11 -0
- package/build/service.d.ts.map +1 -1
- package/build/service.js +38 -2
- package/package.json +3 -3
package/build/service.d.ts
CHANGED
|
@@ -31,6 +31,15 @@ export default class BrowserstackService implements Services.ServiceInstance {
|
|
|
31
31
|
beforeFeature(uri: unknown, feature: {
|
|
32
32
|
name: string;
|
|
33
33
|
}): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Runs before a Cucumber Scenario.
|
|
36
|
+
* @param world world object containing information on pickle and test step
|
|
37
|
+
*/
|
|
38
|
+
beforeScenario(world: Frameworks.World): Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* For CucumberJS
|
|
41
|
+
*/
|
|
42
|
+
beforeStep(step: Frameworks.PickleStep): Promise<void>;
|
|
34
43
|
afterTest(test: Frameworks.Test, context: never, results: Frameworks.TestResult): void;
|
|
35
44
|
after(result: number): Promise<void>;
|
|
36
45
|
/**
|
|
@@ -44,5 +53,7 @@ export default class BrowserstackService implements Services.ServiceInstance {
|
|
|
44
53
|
_update(sessionId: string, requestBody: any): import("got").CancelableRequest<import("got").Response<string>>;
|
|
45
54
|
_printSessionURL(): Promise<void>;
|
|
46
55
|
private _setSessionName;
|
|
56
|
+
private _setAnnotation;
|
|
57
|
+
private _executeCommand;
|
|
47
58
|
}
|
|
48
59
|
//# sourceMappingURL=service.d.ts.map
|
package/build/service.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAEA,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,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CAAC,KAAK;IAK7C;;OAEG;IACG,UAAU,CAAE,IAAI,EAAE,UAAU,CAAC,UAAU;IAK7C,SAAS,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,CAAC,UAAU;IAOzE,KAAK,CAAE,MAAM,EAAE,MAAM;IAkB3B;;OAEG;IACH,aAAa,CAAE,KAAK,EAAE,UAAU,CAAC,KAAK;IAmBhC,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM;IAgCzD,cAAc,IAAI,OAAO;IAOzB,UAAU,CAAE,WAAW,EAAE,GAAG;IAU5B,kBAAkB,CAAE,MAAM,EAAE,iBAAiB;IAqB7C,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG;IAUrC,gBAAgB;YAuBR,eAAe;IA0B7B,OAAO,CAAC,cAAc;YAIR,eAAe;CAqBhC"}
|
package/build/service.js
CHANGED
|
@@ -70,6 +70,7 @@ class BrowserstackService {
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
async beforeTest(test) {
|
|
73
|
+
var _a;
|
|
73
74
|
let suiteTitle = this._suiteTitle;
|
|
74
75
|
if (test.fullName) {
|
|
75
76
|
// For Jasmine, `suite.title` is `Jasmine__TopLevel__Suite`.
|
|
@@ -83,13 +84,30 @@ class BrowserstackService {
|
|
|
83
84
|
}
|
|
84
85
|
}
|
|
85
86
|
await this._setSessionName(suiteTitle, test);
|
|
87
|
+
await this._setAnnotation(`Test: ${(_a = test.fullName) !== null && _a !== void 0 ? _a : test.title}`);
|
|
86
88
|
}
|
|
87
89
|
/**
|
|
88
90
|
* For CucumberJS
|
|
89
91
|
*/
|
|
90
|
-
beforeFeature(uri, feature) {
|
|
92
|
+
async beforeFeature(uri, feature) {
|
|
91
93
|
this._suiteTitle = feature.name;
|
|
92
|
-
|
|
94
|
+
await this._setSessionName(feature.name);
|
|
95
|
+
await this._setAnnotation(`Feature: ${feature.name}`);
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Runs before a Cucumber Scenario.
|
|
99
|
+
* @param world world object containing information on pickle and test step
|
|
100
|
+
*/
|
|
101
|
+
async beforeScenario(world) {
|
|
102
|
+
const scenarioName = world.pickle.name || 'unknown scenario';
|
|
103
|
+
await this._setAnnotation(`Scenario: ${scenarioName}`);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* For CucumberJS
|
|
107
|
+
*/
|
|
108
|
+
async beforeStep(step) {
|
|
109
|
+
const { keyword, text } = step;
|
|
110
|
+
await this._setAnnotation(`Step: ${keyword}${text}`);
|
|
93
111
|
}
|
|
94
112
|
afterTest(test, context, results) {
|
|
95
113
|
const { error, passed } = results;
|
|
@@ -234,5 +252,23 @@ class BrowserstackService {
|
|
|
234
252
|
await this._updateJob({ name });
|
|
235
253
|
}
|
|
236
254
|
}
|
|
255
|
+
_setAnnotation(data) {
|
|
256
|
+
return this._executeCommand('annotate', { data, level: 'info' });
|
|
257
|
+
}
|
|
258
|
+
async _executeCommand(action, args) {
|
|
259
|
+
if (!this._browser) {
|
|
260
|
+
return Promise.resolve();
|
|
261
|
+
}
|
|
262
|
+
const cmd = { action, ...(args ? { arguments: args } : {}) };
|
|
263
|
+
const script = `browserstack_executor: ${JSON.stringify(cmd)}`;
|
|
264
|
+
if (this._browser.isMultiremote) {
|
|
265
|
+
const multiRemoteBrowser = this._browser;
|
|
266
|
+
return Promise.all(Object.keys(this._caps).map(async (browserName) => {
|
|
267
|
+
const browser = multiRemoteBrowser[browserName];
|
|
268
|
+
return (await browser.execute(script));
|
|
269
|
+
}));
|
|
270
|
+
}
|
|
271
|
+
return (await this._browser.execute(script));
|
|
272
|
+
}
|
|
237
273
|
}
|
|
238
274
|
exports.default = BrowserstackService;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/browserstack-service",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.28.1",
|
|
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",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"browserstack-local": "^1.4.5",
|
|
30
30
|
"form-data": "^4.0.0",
|
|
31
31
|
"got": "^11.0.2",
|
|
32
|
-
"webdriverio": "7.
|
|
32
|
+
"webdriverio": "7.28.1"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"@wdio/cli": "^5.0.0 || ^6.0.0 || ^7.0.0"
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
40
|
"types": "./build/index.d.ts",
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "8cf543de7cecb348f0fd9c6d7b470ad6fdc74215"
|
|
42
42
|
}
|