@alex_neo/playwright-azure-reporter 1.1.0 → 1.2.0-beta.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/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ # [1.2.0-beta.0](https://github.com/alexneo2003/playwright-azure-reporter/compare/v1.1.1...v1.2.0-beta.0) (2022-09-30)
2
+
3
+
4
+ ### Features
5
+
6
+ * Refactoring ([8f2545d](https://github.com/alexneo2003/playwright-azure-reporter/commit/8f2545d79cf9e3015498fcc01823d9ecbb47de8a))
7
+
8
+
9
+
10
+ ## [1.1.1](https://github.com/alexneo2003/playwright-azure-reporter/compare/v1.1.0...v1.1.1) (2022-07-26)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * handling the existence of an attachment ([d16efbc](https://github.com/alexneo2003/playwright-azure-reporter/commit/d16efbcb099284ca3baa71e346199d968ed9e7cf))
16
+
17
+
18
+
1
19
  # [1.1.0](https://github.com/alexneo2003/playwright-azure-reporter/compare/v1.0.4...v1.1.0) (2022-07-19)
2
20
 
3
21
 
package/README.md CHANGED
@@ -7,6 +7,7 @@ npm install @alex_neo/playwright-azure-reporter
7
7
  ```
8
8
 
9
9
  ## Usage
10
+
10
11
  You must register an ID already existing test cases from Azure DevOps before running tests.
11
12
 
12
13
  > **You need write testCaseId wraped in square brackets at the test name.**
@@ -17,30 +18,30 @@ For example:
17
18
  describe('Test suite', () => {
18
19
  test('[1] First Test', () => {
19
20
  expect(true).toBe(true);
20
- })
21
+ });
21
22
 
22
23
  test('[3] Correct test', () => {
23
24
  expect(true).toBe(true);
24
- })
25
+ });
25
26
 
26
27
  test.skip('[4] Skipped test', () => {
27
28
  expect(true).toBe(true);
28
- })
29
+ });
29
30
 
30
31
  test('[6] Failed test', () => {
31
32
  expect(true).toBe(false);
32
- })
33
+ });
33
34
  });
34
-
35
35
  ```
36
36
 
37
37
  Configure Playwright Azure Reporter with `playwright-azure-reporter` package.
38
38
 
39
- ```playwright.config.ts```
39
+ `playwright.config.ts`
40
+
40
41
  ```typescript
41
- import { PlaywrightTestConfig } from '@playwright/test'
42
- import azureConfig from './azure.config.json'
43
- import { AzureReporterOptions } from './src/playwright-azure-reporter'
42
+ import { PlaywrightTestConfig } from '@playwright/test';
43
+ import azureConfig from './azure.config.json';
44
+ import { AzureReporterOptions } from './src/playwright-azure-reporter';
44
45
 
45
46
  /**
46
47
  * See https://playwright.dev/docs/test-configuration.
@@ -49,7 +50,7 @@ const config: PlaywrightTestConfig = {
49
50
  testDir: './tests',
50
51
  timeout: 30 * 1000,
51
52
  expect: {
52
- timeout: 5000
53
+ timeout: 5000,
53
54
  },
54
55
  forbidOnly: !!process.env.CI,
55
56
  retries: process.env.CI ? 2 : 0,
@@ -59,41 +60,49 @@ const config: PlaywrightTestConfig = {
59
60
  [
60
61
  '@alex_neo/playwright-azure-reporter',
61
62
  {
62
- orgUrl: "https://dev.azure.com/your-organization-name",
63
- token: "AZURE-TOKEN",
63
+ orgUrl: 'https://dev.azure.com/your-organization-name',
64
+ token: 'AZURE-TOKEN',
64
65
  planId: 44,
65
- projectName: "SampleSample",
66
+ projectName: 'SampleSample',
66
67
  environment: 'AQA',
68
+ logging: true,
67
69
  testRunTitle: 'Playwright Test Run',
68
70
  uploadAttachments: true,
69
71
  attachmentsType: ['screenshot', 'video', 'trace'],
70
- } as AzureReporterOptions
71
- ]
72
+ testRunConfig: {
73
+ owner: {
74
+ displayName: 'Alex Neo',
75
+ },
76
+ comment: 'Playwright Test Run',
77
+ },
78
+ } as AzureReporterOptions,
79
+ ],
72
80
  ],
73
81
  use: {
74
82
  screenshot: 'only-on-failure',
75
83
  actionTimeout: 0,
76
- trace: 'on-first-retry'
77
- }
78
- }
79
-
80
- export default config
84
+ trace: 'on-first-retry',
85
+ },
86
+ };
81
87
 
88
+ export default config;
82
89
  ```
83
90
 
84
91
  ## Configuration
85
92
 
86
- Reporter options (* - required):
93
+ Reporter options (\* - required):
87
94
 
88
- - *`token` - Azure DevOps token, you can find more information [here](https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops&tabs=Windows)
89
- - *`orgUrl` - Full url for your organization space. Example: `https://dev.azure.com/your-organization-name`
95
+ - \*`token` - Azure DevOps token, you can find more information [here](https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops&tabs=Windows)
96
+ - \*`orgUrl` - Full url for your organization space. Example: `https://dev.azure.com/your-organization-name`
90
97
 
91
98
  > Please note that some API's (e.g. ProfileApi) can't be hit at the org level, and has to be hit at the deployment level, so url should be structured like https://vssps.dev.azure.com/{yourorgname}
92
- - *`projectName` - Name of your project (also can be got from run URL). Example: `https://dev.azure.com/alex-neo/SampleProject/` - __SampleProject__
93
- - *`planId` - Id of test plan. You can find it in test plan URL. Example: `https://dev.azure.com/alex-neo/SampleProject/_testPlans/execute?planId=4&suiteId=6` - __planId=4__
99
+
100
+ - \*`projectName` - Name of your project (also can be got from run URL). Example: `https://dev.azure.com/alex-neo/SampleProject/` - **SampleProject**
101
+ - \*`planId` - Id of test plan. You can find it in test plan URL. Example: `https://dev.azure.com/alex-neo/SampleProject/_testPlans/execute?planId=4&suiteId=6` - **planId=4**
94
102
  - `environment` - Any string that will be used as environment name. Will be used as prefix for all test runs. Default: `undefined`. Example: `QA`
95
- - `logging` [true/false] - Enabled debug logging from reporter or not. Default: `true`.
103
+ - `logging` [true/false] - Enabled debug logging from reporter or not. Default: `false`.
96
104
  - `uploadAttachments` [true/false] - Uploading attachments (screenshot/video) after test ended. Default: `false`.
97
105
  - `attachmentsType` - List of attachments types that will be uploaded. Default: `['screenshot']`.
98
106
  - `isDisabled` [true/false] - Disable reporter. Default: `false`.
99
107
  - `testRunTitle` - Title of test run using to create new test run. Default: `Playwright Test Run`.
108
+ - `testRunConfig` - Extra data to pass when Test Run creating. Read [doc](https://learn.microsoft.com/en-us/rest/api/azure/devops/test/runs/create?view=azure-devops-rest-7.1&tabs=HTTP#request-body) from more information. Default: `empty`.
@@ -1,7 +1,9 @@
1
+ import * as TestInterfaces from 'azure-devops-node-api/interfaces/TestInterfaces';
1
2
  import { Reporter, TestCase, TestResult } from '@playwright/test/reporter';
2
3
  export declare function createGuid(): string;
3
4
  declare const attachmentTypesArray: readonly ["screenshot", "video", "trace"];
4
5
  declare type TAttachmentType = Array<typeof attachmentTypesArray[number]>;
6
+ declare type TTestRunConfig = Omit<TestInterfaces.RunCreateModel, 'name' | 'configurationIds' | 'automated' | 'plan' | 'pointIds'> | undefined;
5
7
  export interface AzureReporterOptions {
6
8
  token: string;
7
9
  planId: number;
@@ -13,11 +15,11 @@ export interface AzureReporterOptions {
13
15
  testRunTitle?: string | undefined;
14
16
  uploadAttachments?: boolean | undefined;
15
17
  attachmentsType?: TAttachmentType | undefined;
18
+ testRunConfig?: TTestRunConfig;
16
19
  }
17
20
  declare class AzureDevOpsReporter implements Reporter {
18
21
  private testApi;
19
22
  private coreApi;
20
- private _options;
21
23
  private publishedResultsCount;
22
24
  private resultsToBePublished;
23
25
  private connection;
@@ -25,27 +27,32 @@ declare class AzureDevOpsReporter implements Reporter {
25
27
  private projectName;
26
28
  private environment?;
27
29
  private planId;
28
- private runId;
29
30
  private logging;
30
31
  private isDisabled;
31
32
  private testRunTitle;
32
33
  private uploadAttachments;
33
34
  private attachmentsType?;
34
35
  private token;
35
- constructor(options?: AzureReporterOptions);
36
+ private runIdPromise;
37
+ private resolveRunId;
38
+ private rejectRunId;
39
+ private testRunConfig;
40
+ constructor(options: AzureReporterOptions);
41
+ _validateOptions(options: AzureReporterOptions): void;
36
42
  onBegin(): Promise<void>;
37
43
  onTestEnd(test: TestCase, testResult: TestResult): Promise<void>;
38
44
  onEnd(): Promise<void>;
39
- private log;
40
- private getCaseIds;
41
- private logTestItem;
42
- private createRun;
43
- private removePublished;
44
- private checkProject;
45
- private getTestPointIdsByTCIds;
46
- private addReportingOverride;
47
- private uploadAttachmentsFunc;
48
- private awaitForRunId;
49
- private publishCaseResult;
45
+ printsToStdio(): boolean;
46
+ private _log;
47
+ private _warning;
48
+ private _getCaseIds;
49
+ private _logTestItem;
50
+ private _createRun;
51
+ private _removePublished;
52
+ private _checkProject;
53
+ private _getTestPointIdsByTCIds;
54
+ private _addReportingOverride;
55
+ private _uploadAttachmentsFunc;
56
+ private _publishCaseResult;
50
57
  }
51
58
  export default AzureDevOpsReporter;
@@ -1,4 +1,15 @@
1
1
  "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
2
13
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
14
  if (k2 === undefined) k2 = k;
4
15
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -63,20 +74,24 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
63
74
  };
64
75
  Object.defineProperty(exports, "__esModule", { value: true });
65
76
  exports.createGuid = void 0;
77
+ /* eslint-disable no-unused-vars */
78
+ /* eslint-disable no-control-regex */
66
79
  var azdev = __importStar(require("azure-devops-node-api"));
67
80
  var chalk_1 = __importDefault(require("chalk"));
68
- var fs_1 = require("fs");
69
81
  var crypto_1 = __importDefault(require("crypto"));
82
+ var fs_1 = require("fs");
70
83
  function createGuid() {
71
84
  return crypto_1.default.randomBytes(16).toString('hex');
72
85
  }
73
86
  exports.createGuid = createGuid;
74
- var Statuses = {
75
- passed: 'Passed',
76
- failed: 'Failed',
77
- skipped: 'Paused',
78
- timedOut: 'Failed'
79
- };
87
+ var AzureTestStatuses;
88
+ (function (AzureTestStatuses) {
89
+ AzureTestStatuses["passed"] = "Passed";
90
+ AzureTestStatuses["failed"] = "Failed";
91
+ AzureTestStatuses["skipped"] = "Paused";
92
+ AzureTestStatuses["timedOut"] = "Failed";
93
+ AzureTestStatuses["interrupted"] = "Failed";
94
+ })(AzureTestStatuses || (AzureTestStatuses = {}));
80
95
  var attachmentTypesArray = [
81
96
  'screenshot',
82
97
  'video',
@@ -84,21 +99,29 @@ var attachmentTypesArray = [
84
99
  ];
85
100
  var AzureDevOpsReporter = /** @class */ (function () {
86
101
  function AzureDevOpsReporter(options) {
87
- if (options === void 0) { options = {}; }
102
+ var _this = this;
88
103
  this.publishedResultsCount = 0;
89
104
  this.resultsToBePublished = [];
90
105
  this.planId = 0;
91
- this.logging = true;
106
+ this.logging = false;
92
107
  this.isDisabled = false;
93
108
  this.testRunTitle = '';
94
109
  this.uploadAttachments = false;
95
110
  this.token = '';
96
- this.addReportingOverride = function (api) {
97
- // https://github.com/microsoft/azure-devops-node-api/issues/318#issuecomment-498802402
111
+ this.resolveRunId = function () { };
112
+ this.rejectRunId = function () { };
113
+ this._addReportingOverride = function (api) {
114
+ /**
115
+ * Override the default behavior of publishing test results to the test run.
116
+ * This is necessary because Microsoft Azure API documentation at version higher than '5.0-preview.5'
117
+ * has undocumented fields and they not implementing at 'azure-devops-node-api/TestApi' package.
118
+ * This function is downgraded the API version to '5.0-preview.5'.
119
+ * https://github.com/microsoft/azure-devops-node-api/issues/318#issuecomment-498802402
120
+ */
98
121
  api.addTestResultsToTestRun = function (results, projectName, runId) {
99
122
  var _this = this;
100
123
  return new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
101
- var routeValues, verData, url, options, res, err_1;
124
+ var routeValues, verData, url, options, res, error_1;
102
125
  return __generator(this, function (_a) {
103
126
  switch (_a.label) {
104
127
  case 0:
@@ -120,8 +143,8 @@ var AzureDevOpsReporter = /** @class */ (function () {
120
143
  resolve(res);
121
144
  return [3 /*break*/, 5];
122
145
  case 4:
123
- err_1 = _a.sent();
124
- reject(err_1);
146
+ error_1 = _a.sent();
147
+ reject(error_1);
125
148
  return [3 /*break*/, 5];
126
149
  case 5: return [2 /*return*/];
127
150
  }
@@ -130,457 +153,468 @@ var AzureDevOpsReporter = /** @class */ (function () {
130
153
  };
131
154
  return api;
132
155
  };
133
- this._options = options;
134
- this.orgUrl = this._options.orgUrl;
135
- this.projectName = this._options.projectName;
136
- this.environment = this._options.environment || undefined;
137
- this.planId = this._options.planId;
138
- this.logging = (typeof this._options.logging === 'undefined') ? true : this._options.logging;
139
- this.isDisabled = this._options.isDisabled || false;
140
- this.testRunTitle = "".concat(this.environment ? "[".concat(this.environment, "]:") : '', " ").concat(this._options.testRunTitle || 'Playwright Test Run') ||
141
- "".concat(this.environment ? "[".concat(this.environment, "]:") : '', "Test plan ").concat(this.planId);
142
- this.uploadAttachments = this._options.uploadAttachments || false;
143
- this.attachmentsType = this._options.attachmentsType;
144
- this.token = this._options.token;
145
- if (!this.orgUrl || this.orgUrl.length === 0) {
146
- this.log(chalk_1.default.yellow("'orgUrl' is not set. Reporting is disabled."));
156
+ this.runIdPromise = new Promise(function (resolve, reject) {
157
+ _this.resolveRunId = resolve;
158
+ _this.rejectRunId = reject;
159
+ }).then(function (runId) {
160
+ return runId;
161
+ }).catch(function (error) {
162
+ _this._warning(error);
163
+ _this.isDisabled = true;
164
+ });
165
+ this._validateOptions(options);
166
+ }
167
+ AzureDevOpsReporter.prototype._validateOptions = function (options) {
168
+ if (options === null || options === void 0 ? void 0 : options.isDisabled) {
147
169
  this.isDisabled = true;
148
170
  return;
149
171
  }
150
- if (!this.projectName || this.projectName.length === 0) {
151
- this.log(chalk_1.default.yellow("'projectName' is not set. Reporting is disabled."));
172
+ if (!(options === null || options === void 0 ? void 0 : options.orgUrl)) {
173
+ this._warning("'orgUrl' is not set. Reporting is disabled.");
152
174
  this.isDisabled = true;
153
175
  return;
154
176
  }
155
- if (!this.planId || this.planId === 0) {
156
- this.log(chalk_1.default.yellow("'planId' is not set. Reporting is disabled."));
177
+ if (!(options === null || options === void 0 ? void 0 : options.projectName)) {
178
+ this._warning("'projectName' is not set. Reporting is disabled.");
157
179
  this.isDisabled = true;
158
180
  return;
159
181
  }
160
- if (!this.token || this.token.length === 0) {
161
- this.log(chalk_1.default.yellow("'token' is not set. Reporting is disabled."));
182
+ if (!(options === null || options === void 0 ? void 0 : options.planId)) {
183
+ this._warning("'planId' is not set. Reporting is disabled.");
162
184
  this.isDisabled = true;
185
+ return;
186
+ }
187
+ if (!(options === null || options === void 0 ? void 0 : options.token)) {
188
+ this._warning("'token' is not set. Reporting is disabled.");
189
+ this.isDisabled = true;
190
+ return;
163
191
  }
164
- if (this.uploadAttachments) {
165
- if (!this.attachmentsType) {
166
- this.log(chalk_1.default.yellow("'attachmentsType' is not set. Attachments Type will be set to 'screenshot' by default."));
192
+ if (options === null || options === void 0 ? void 0 : options.uploadAttachments) {
193
+ if (!(options === null || options === void 0 ? void 0 : options.attachmentsType)) {
194
+ this._warning("'attachmentsType' is not set. Attachments Type will be set to 'screenshot' by default.");
167
195
  this.attachmentsType = ['screenshot'];
168
196
  }
197
+ else {
198
+ this.attachmentsType = options.attachmentsType;
199
+ }
169
200
  }
201
+ this.orgUrl = options.orgUrl;
202
+ this.projectName = options.projectName;
203
+ this.planId = options.planId;
204
+ this.logging = options.logging || false;
205
+ this.token = options.token;
206
+ this.environment = (options === null || options === void 0 ? void 0 : options.environment) || undefined;
207
+ this.testRunTitle = "".concat(this.environment ? "[".concat(this.environment, "]:") : '', " ").concat((options === null || options === void 0 ? void 0 : options.testRunTitle) || 'Playwright Test Run') ||
208
+ "".concat(this.environment ? "[".concat(this.environment, "]:") : '', "Test plan ").concat(this.planId);
209
+ this.uploadAttachments = (options === null || options === void 0 ? void 0 : options.uploadAttachments) || false;
170
210
  this.connection = new azdev.WebApi(this.orgUrl, azdev.getPersonalAccessTokenHandler(this.token));
171
- }
211
+ this.testRunConfig = (options === null || options === void 0 ? void 0 : options.testRunConfig) || undefined;
212
+ };
172
213
  AzureDevOpsReporter.prototype.onBegin = function () {
173
214
  return __awaiter(this, void 0, void 0, function () {
174
- var _a;
175
- var _this = this;
215
+ var _a, run, error_2, parsedError;
176
216
  return __generator(this, function (_b) {
177
217
  switch (_b.label) {
178
218
  case 0:
179
219
  if (this.isDisabled)
180
220
  return [2 /*return*/];
221
+ _b.label = 1;
222
+ case 1:
223
+ _b.trys.push([1, 4, , 5]);
181
224
  _a = this;
182
225
  return [4 /*yield*/, this.connection.getTestApi()];
183
- case 1:
226
+ case 2:
184
227
  _a.testApi = _b.sent();
185
- this.createRun(this.testRunTitle).then(function (run) {
186
- if (run) {
187
- _this.runId = run.id;
188
- _this.log(chalk_1.default.green("Using run ".concat(_this.runId, " to publish test results")));
189
- }
190
- else {
191
- _this.isDisabled = true;
192
- }
193
- });
194
- return [2 /*return*/];
228
+ return [4 /*yield*/, this._createRun(this.testRunTitle)];
229
+ case 3:
230
+ run = _b.sent();
231
+ if (run === null || run === void 0 ? void 0 : run.id) {
232
+ this.resolveRunId(run.id);
233
+ this._log(chalk_1.default.green("Using run ".concat(run.id, " to publish test results")));
234
+ }
235
+ else {
236
+ this.isDisabled = true;
237
+ this.rejectRunId('Failed to create test run. Reporting is disabled.');
238
+ }
239
+ return [3 /*break*/, 5];
240
+ case 4:
241
+ error_2 = _b.sent();
242
+ this.isDisabled = true;
243
+ if (error_2.message.includes('401')) {
244
+ this._warning('Failed to create test run. Check your token. Reporting is disabled.');
245
+ }
246
+ else if (error_2.message.includes('getaddrinfo ENOTFOUND')) {
247
+ this._warning('Failed to create test run. Check your orgUrl. Reporting is disabled.');
248
+ }
249
+ else {
250
+ this._warning('Failed to create test run. Reporting is disabled.');
251
+ parsedError = JSON.parse(String(error_2.message.trim()));
252
+ this._warning((parsedError === null || parsedError === void 0 ? void 0 : parsedError.message) || error_2.message);
253
+ }
254
+ return [3 /*break*/, 5];
255
+ case 5: return [2 /*return*/];
195
256
  }
196
257
  });
197
258
  });
198
259
  };
199
260
  AzureDevOpsReporter.prototype.onTestEnd = function (test, testResult) {
200
261
  return __awaiter(this, void 0, void 0, function () {
201
- var _this = this;
262
+ var runId, error_3;
202
263
  return __generator(this, function (_a) {
203
264
  switch (_a.label) {
204
- case 0: return [4 /*yield*/, this.awaitForRunId().catch(function (e) {
205
- _this.log(chalk_1.default.red(e));
206
- })];
207
- case 1:
208
- _a.sent();
265
+ case 0:
209
266
  if (this.isDisabled)
210
267
  return [2 /*return*/];
211
- this.logTestItem(test, testResult);
212
- return [4 /*yield*/, this.publishCaseResult(test, testResult)];
268
+ _a.label = 1;
269
+ case 1:
270
+ _a.trys.push([1, 4, , 5]);
271
+ return [4 /*yield*/, this.runIdPromise];
213
272
  case 2:
273
+ runId = _a.sent();
274
+ if (!runId)
275
+ return [2 /*return*/];
276
+ this._logTestItem(test, testResult);
277
+ return [4 /*yield*/, this._publishCaseResult(test, testResult)];
278
+ case 3:
214
279
  _a.sent();
215
- return [2 /*return*/];
280
+ return [3 /*break*/, 5];
281
+ case 4:
282
+ error_3 = _a.sent();
283
+ this._warning("Failed to publish test result. \n ".concat(error_3.message));
284
+ return [3 /*break*/, 5];
285
+ case 5: return [2 /*return*/];
216
286
  }
217
287
  });
218
288
  });
219
289
  };
220
290
  AzureDevOpsReporter.prototype.onEnd = function () {
221
291
  return __awaiter(this, void 0, void 0, function () {
222
- var prevCount, runUpdate, _a, runUpdatedResponse, err_2;
223
- var _this = this;
292
+ var runId, prevCount, _a, runUpdatedResponse, error_4;
224
293
  return __generator(this, function (_b) {
225
294
  switch (_b.label) {
226
- case 0: return [4 /*yield*/, this.awaitForRunId().catch(function (e) {
227
- _this.log(chalk_1.default.red(e));
228
- })];
229
- case 1:
230
- _b.sent();
295
+ case 0:
231
296
  if (this.isDisabled)
232
297
  return [2 /*return*/];
233
- prevCount = this.resultsToBePublished.length;
234
- _b.label = 2;
298
+ _b.label = 1;
299
+ case 1:
300
+ _b.trys.push([1, 9, , 10]);
301
+ return [4 /*yield*/, this.runIdPromise];
235
302
  case 2:
236
- if (!(this.resultsToBePublished.length > 0)) return [3 /*break*/, 4];
303
+ runId = _b.sent();
304
+ prevCount = this.resultsToBePublished.length;
305
+ _b.label = 3;
306
+ case 3:
307
+ if (!(this.resultsToBePublished.length > 0)) return [3 /*break*/, 5];
237
308
  // need wait all results to be published
238
309
  if (prevCount > this.resultsToBePublished.length) {
239
- this.log(chalk_1.default.gray("Waiting for all results to be published. Remaining ".concat(this.resultsToBePublished.length, " results")));
310
+ this._log(chalk_1.default.gray("Waiting for all results to be published. Remaining ".concat(this.resultsToBePublished.length, " results")));
240
311
  prevCount--;
241
312
  }
242
313
  return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, 250); })];
243
- case 3:
244
- _b.sent();
245
- return [3 /*break*/, 2];
246
314
  case 4:
247
- if (this.publishedResultsCount === 0 && !this.runId) {
248
- this.log('No testcases were matched. Ensure that your tests are declared correctly.');
315
+ _b.sent();
316
+ return [3 /*break*/, 3];
317
+ case 5:
318
+ if (this.publishedResultsCount === 0 && !runId) {
319
+ this._log(chalk_1.default.gray('No testcases were matched. Ensure that your tests are declared correctly.'));
249
320
  return [2 /*return*/];
250
321
  }
251
- _b.label = 5;
252
- case 5:
253
- _b.trys.push([5, 9, , 10]);
254
- runUpdate = {
255
- state: 'Completed'
256
- };
257
322
  if (!!this.testApi) return [3 /*break*/, 7];
258
323
  _a = this;
259
324
  return [4 /*yield*/, this.connection.getTestApi()];
260
325
  case 6:
261
326
  _a.testApi = _b.sent();
262
327
  _b.label = 7;
263
- case 7: return [4 /*yield*/, this.testApi.updateTestRun(runUpdate, this.projectName, this.runId)];
328
+ case 7: return [4 /*yield*/, this.testApi.updateTestRun({ state: 'Completed' }, this.projectName, runId)];
264
329
  case 8:
265
330
  runUpdatedResponse = _b.sent();
266
- this.log(chalk_1.default.green("Run ".concat(this.runId, " - ").concat(runUpdatedResponse.state)));
331
+ this._log(chalk_1.default.green("Run ".concat(runId, " - ").concat(runUpdatedResponse.state)));
267
332
  return [3 /*break*/, 10];
268
333
  case 9:
269
- err_2 = _b.sent();
270
- this.log("Error on completing run ".concat(err_2));
334
+ error_4 = _b.sent();
335
+ this._warning(chalk_1.default.red("Error on completing run ".concat(error_4)));
271
336
  return [3 /*break*/, 10];
272
337
  case 10: return [2 /*return*/];
273
338
  }
274
339
  });
275
340
  });
276
341
  };
277
- AzureDevOpsReporter.prototype.log = function (message) {
278
- if (this.logging)
342
+ AzureDevOpsReporter.prototype.printsToStdio = function () {
343
+ return true;
344
+ };
345
+ AzureDevOpsReporter.prototype._log = function (message) {
346
+ if (this.logging) {
279
347
  console.log(chalk_1.default.magenta("azure: ".concat(message)));
348
+ }
349
+ };
350
+ AzureDevOpsReporter.prototype._warning = function (message) {
351
+ console.log("".concat(chalk_1.default.magenta('azure:'), " ").concat(chalk_1.default.yellow(message)));
280
352
  };
281
- AzureDevOpsReporter.prototype.getCaseIds = function (test) {
282
- var regexp = /\[([\d,]+)\]/;
283
- var results = regexp.exec(test.title);
353
+ AzureDevOpsReporter.prototype._getCaseIds = function (test) {
354
+ var results = /\[([\d,]+)\]/.exec(test.title);
284
355
  if (results && results.length === 2)
285
356
  return results[1];
286
- return '';
287
357
  };
288
- AzureDevOpsReporter.prototype.logTestItem = function (test, testResult) {
289
- var map = {
290
- failed: chalk_1.default.red("Test ".concat(test.title, " - ").concat(testResult.status)),
291
- passed: chalk_1.default.green("Test ".concat(test.title, " - ").concat(testResult.status)),
292
- skipped: chalk_1.default.blue("Test ".concat(test.title, " - ").concat(testResult.status)),
293
- pending: chalk_1.default.blue("Test ".concat(test.title, " - ").concat(testResult.status)),
294
- disabled: chalk_1.default.gray("Test ".concat(test.title, " - ").concat(testResult.status)),
295
- timedOut: chalk_1.default.gray("Test ".concat(test.title, " - ").concat(testResult.status))
296
- };
297
- if (testResult.status)
298
- this.log(map[testResult.status]);
358
+ AzureDevOpsReporter.prototype._logTestItem = function (test, testResult) {
359
+ switch (testResult.status) {
360
+ case 'passed':
361
+ this._log(chalk_1.default.green("".concat(test.title, " - ").concat(testResult.status)));
362
+ break;
363
+ case 'failed':
364
+ this._log(chalk_1.default.red("".concat(test.title, " - ").concat(testResult.status)));
365
+ break;
366
+ case 'timedOut':
367
+ this._log(chalk_1.default.yellow("".concat(test.title, " - ").concat(testResult.status)));
368
+ break;
369
+ case 'skipped':
370
+ this._log(chalk_1.default.yellow("".concat(test.title, " - ").concat(testResult.status)));
371
+ break;
372
+ case 'interrupted':
373
+ this._log(chalk_1.default.red("".concat(test.title, " - ").concat(testResult.status)));
374
+ break;
375
+ default:
376
+ this._log("".concat(test.title, " - ").concat(testResult.status));
377
+ break;
378
+ }
299
379
  };
300
- AzureDevOpsReporter.prototype.createRun = function (runName) {
380
+ AzureDevOpsReporter.prototype._createRun = function (runName) {
301
381
  return __awaiter(this, void 0, void 0, function () {
302
- var _this = this;
303
- return __generator(this, function (_a) {
304
- return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
305
- var runModel, _a, adTestRun, e_1;
306
- return __generator(this, function (_b) {
307
- switch (_b.label) {
308
- case 0:
309
- _b.trys.push([0, 4, , 5]);
310
- this.checkProject(this.projectName).catch(function (e) {
311
- reject(e);
312
- });
313
- runModel = {
314
- name: runName,
315
- automated: true,
316
- configurationIds: [1],
317
- plan: { id: "".concat(this.planId) }
318
- };
319
- if (!!this.testApi) return [3 /*break*/, 2];
320
- _a = this;
321
- return [4 /*yield*/, this.connection.getTestApi()];
322
- case 1:
323
- _a.testApi = _b.sent();
324
- _b.label = 2;
325
- case 2: return [4 /*yield*/, this.testApi.createTestRun(runModel, this.projectName)];
326
- case 3:
327
- adTestRun = _b.sent();
328
- resolve(adTestRun);
329
- return [3 /*break*/, 5];
330
- case 4:
331
- e_1 = _b.sent();
332
- reject(e_1);
333
- return [3 /*break*/, 5];
334
- case 5: return [2 /*return*/];
335
- }
336
- });
337
- }); }).catch(function (e) {
338
- _this.log(chalk_1.default.red("While creating test run.\n ".concat(e)));
339
- _this.isDisabled = true;
340
- throw e;
341
- })];
382
+ var isExists, runModel, _a, adTestRun, error_5;
383
+ return __generator(this, function (_b) {
384
+ switch (_b.label) {
385
+ case 0:
386
+ _b.trys.push([0, 7, , 8]);
387
+ return [4 /*yield*/, this._checkProject(this.projectName)];
388
+ case 1:
389
+ isExists = _b.sent();
390
+ if (!!isExists) return [3 /*break*/, 2];
391
+ return [2 /*return*/];
392
+ case 2:
393
+ runModel = __assign({ name: runName, automated: true, configurationIds: [1], plan: { id: String(this.planId) } }, (this.testRunConfig && this.testRunConfig));
394
+ if (!!this.testApi) return [3 /*break*/, 4];
395
+ _a = this;
396
+ return [4 /*yield*/, this.connection.getTestApi()];
397
+ case 3:
398
+ _a.testApi = _b.sent();
399
+ _b.label = 4;
400
+ case 4: return [4 /*yield*/, this.testApi.createTestRun(runModel, this.projectName)];
401
+ case 5:
402
+ adTestRun = _b.sent();
403
+ if (adTestRun === null || adTestRun === void 0 ? void 0 : adTestRun.id)
404
+ return [2 /*return*/, adTestRun];
405
+ else
406
+ throw new Error('Failed to create test run');
407
+ _b.label = 6;
408
+ case 6: return [3 /*break*/, 8];
409
+ case 7:
410
+ error_5 = _b.sent();
411
+ this._warning(chalk_1.default.red(error_5.message));
412
+ this.isDisabled = true;
413
+ return [3 /*break*/, 8];
414
+ case 8: return [2 /*return*/];
415
+ }
342
416
  });
343
417
  });
344
418
  };
345
- AzureDevOpsReporter.prototype.removePublished = function (testAlias) {
419
+ AzureDevOpsReporter.prototype._removePublished = function (testAlias) {
346
420
  var resultIndex = this.resultsToBePublished.indexOf(testAlias);
347
421
  if (resultIndex !== -1)
348
422
  this.resultsToBePublished.splice(resultIndex, 1);
349
423
  };
350
- AzureDevOpsReporter.prototype.checkProject = function (projectName) {
424
+ AzureDevOpsReporter.prototype._checkProject = function (projectName) {
351
425
  return __awaiter(this, void 0, void 0, function () {
352
- var _this = this;
353
- return __generator(this, function (_a) {
354
- return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
355
- var _a, project, e_2;
356
- return __generator(this, function (_b) {
357
- switch (_b.label) {
358
- case 0:
359
- _b.trys.push([0, 4, , 5]);
360
- if (!!this.coreApi) return [3 /*break*/, 2];
361
- _a = this;
362
- return [4 /*yield*/, this.connection.getCoreApi()];
363
- case 1:
364
- _a.coreApi = _b.sent();
365
- _b.label = 2;
366
- case 2: return [4 /*yield*/, this.coreApi.getProject(projectName)];
367
- case 3:
368
- project = _b.sent();
369
- if (project)
370
- resolve(project);
371
- else
372
- reject("Project ".concat(projectName, " does not exist. Reporting is disabled."));
373
- return [3 /*break*/, 5];
374
- case 4:
375
- e_2 = _b.sent();
376
- reject(e_2);
377
- return [3 /*break*/, 5];
378
- case 5: return [2 /*return*/];
379
- }
380
- });
381
- }); }).catch(function (e) {
382
- _this.log(e);
383
- _this.isDisabled = true;
384
- })];
385
- });
386
- });
387
- };
388
- AzureDevOpsReporter.prototype.getTestPointIdsByTCIds = function (planId, testcaseIds) {
389
- return __awaiter(this, void 0, void 0, function () {
390
- var _this = this;
391
- return __generator(this, function (_a) {
392
- return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
393
- var pointsQuery, _a, pointsQueryResult, pointsIds_1, e_3;
394
- var _this = this;
395
- return __generator(this, function (_b) {
396
- switch (_b.label) {
397
- case 0:
398
- _b.trys.push([0, 4, , 5]);
399
- pointsQuery = {
400
- pointsFilter: { testcaseIds: testcaseIds }
401
- };
402
- if (!!this.testApi) return [3 /*break*/, 2];
403
- _a = this;
404
- return [4 /*yield*/, this.connection.getTestApi()];
405
- case 1:
406
- _a.testApi = _b.sent();
407
- _b.label = 2;
408
- case 2: return [4 /*yield*/, this.testApi.getPointsByQuery(pointsQuery, this.projectName)];
409
- case 3:
410
- pointsQueryResult = _b.sent();
411
- pointsIds_1 = [];
412
- if (pointsQueryResult.points) {
413
- pointsQueryResult.points.forEach(function (point) {
414
- if (point.testPlan && point.testPlan.id && parseInt(point.testPlan.id, 10) === planId)
415
- pointsIds_1.push(point.id);
416
- else
417
- reject("Could not find test point for test case [".concat(point.testCase.id, "] associated with test plan ").concat(_this.planId, ". Check, maybe testPlanId, what you specifiyed, is incorrect."));
418
- });
419
- }
420
- resolve(pointsIds_1);
421
- return [3 /*break*/, 5];
422
- case 4:
423
- e_3 = _b.sent();
424
- this.log(chalk_1.default.red("While getting test points ids, by test cases ids.\n ".concat(e_3)));
425
- reject(e_3);
426
- return [3 /*break*/, 5];
427
- case 5: return [2 /*return*/];
428
- }
429
- });
430
- }); })];
426
+ var _a, project, error_6;
427
+ return __generator(this, function (_b) {
428
+ switch (_b.label) {
429
+ case 0:
430
+ _b.trys.push([0, 4, , 5]);
431
+ if (!!this.coreApi) return [3 /*break*/, 2];
432
+ _a = this;
433
+ return [4 /*yield*/, this.connection.getCoreApi()];
434
+ case 1:
435
+ _a.coreApi = _b.sent();
436
+ _b.label = 2;
437
+ case 2: return [4 /*yield*/, this.coreApi.getProject(projectName)];
438
+ case 3:
439
+ project = _b.sent();
440
+ if (project)
441
+ return [2 /*return*/, project];
442
+ else
443
+ throw new Error("Project ".concat(projectName, " does not exist. Reporting is disabled."));
444
+ return [3 /*break*/, 5];
445
+ case 4:
446
+ error_6 = _b.sent();
447
+ this._warning(chalk_1.default.red(error_6.message));
448
+ this.isDisabled = true;
449
+ return [3 /*break*/, 5];
450
+ case 5: return [2 /*return*/];
451
+ }
431
452
  });
432
453
  });
433
454
  };
434
- AzureDevOpsReporter.prototype.uploadAttachmentsFunc = function (testResult, caseId, testCaseId) {
455
+ AzureDevOpsReporter.prototype._getTestPointIdsByTCIds = function (planId, testcaseIds) {
435
456
  return __awaiter(this, void 0, void 0, function () {
436
- var _this = this;
437
- return __generator(this, function (_a) {
438
- switch (_a.label) {
457
+ var pointsIds, pointsQuery, _a, pointsQueryResult, error_7;
458
+ return __generator(this, function (_b) {
459
+ switch (_b.label) {
439
460
  case 0:
440
- this.log(chalk_1.default.gray("Start upload attachments for test case [".concat(testCaseId, "]")));
441
- return [4 /*yield*/, Promise.all(testResult.attachments.map(function (attachment) { return __awaiter(_this, void 0, void 0, function () {
442
- var attachments, _a, response;
443
- return __generator(this, function (_b) {
444
- switch (_b.label) {
445
- case 0:
446
- if (!this.attachmentsType.includes(attachment.name)) return [3 /*break*/, 4];
447
- attachments = {
448
- attachmentType: 'GeneralAttachment',
449
- fileName: "".concat(attachment.name, "-").concat(createGuid(), ".").concat(attachment.contentType.split('/')[1]),
450
- stream: (0, fs_1.readFileSync)(attachment.path, { encoding: 'base64' })
451
- };
452
- if (!!this.testApi) return [3 /*break*/, 2];
453
- _a = this;
454
- return [4 /*yield*/, this.connection.getTestApi()];
455
- case 1:
456
- _a.testApi = _b.sent();
457
- _b.label = 2;
458
- case 2: return [4 /*yield*/, this.testApi.createTestResultAttachment(attachments, this.projectName, this.runId, caseId)];
459
- case 3:
460
- response = _b.sent();
461
- return [2 /*return*/, response.url];
462
- case 4: return [2 /*return*/, ''];
463
- }
464
- });
465
- }); }))];
466
- case 1: return [2 /*return*/, _a.sent()];
461
+ pointsIds = [];
462
+ _b.label = 1;
463
+ case 1:
464
+ _b.trys.push([1, 5, , 6]);
465
+ pointsQuery = {
466
+ pointsFilter: { testcaseIds: testcaseIds }
467
+ };
468
+ if (!!this.testApi) return [3 /*break*/, 3];
469
+ _a = this;
470
+ return [4 /*yield*/, this.connection.getTestApi()];
471
+ case 2:
472
+ _a.testApi = _b.sent();
473
+ _b.label = 3;
474
+ case 3: return [4 /*yield*/, this.testApi.getPointsByQuery(pointsQuery, this.projectName)];
475
+ case 4:
476
+ pointsQueryResult = _b.sent();
477
+ if (pointsQueryResult.points) {
478
+ pointsQueryResult.points.forEach(function (point) {
479
+ if (point.testPlan && point.testPlan.id && parseInt(point.testPlan.id, 10) === planId) {
480
+ pointsIds.push(point.id);
481
+ }
482
+ });
483
+ }
484
+ if (pointsIds.length === 0) {
485
+ throw new Error("Could not find test point for test cases [".concat(testcaseIds.join(','), "] associated with test plan ").concat(this.planId, ". Check, maybe testPlanId, what you specified, is incorrect."));
486
+ }
487
+ return [2 /*return*/, pointsIds];
488
+ case 5:
489
+ error_7 = _b.sent();
490
+ this._warning(chalk_1.default.red(error_7.message));
491
+ return [3 /*break*/, 6];
492
+ case 6: return [2 /*return*/, pointsIds];
467
493
  }
468
494
  });
469
495
  });
470
496
  };
471
- AzureDevOpsReporter.prototype.awaitForRunId = function () {
497
+ AzureDevOpsReporter.prototype._uploadAttachmentsFunc = function (testResult, caseId, testCaseId) {
472
498
  return __awaiter(this, void 0, void 0, function () {
473
- var _this = this;
474
- return __generator(this, function (_a) {
475
- // need wait runId variable to be initialised in onBegin() hook
476
- if (this.isDisabled)
477
- return [2 /*return*/];
478
- return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
479
- var timeout, startTime;
480
- return __generator(this, function (_a) {
481
- switch (_a.label) {
482
- case 0:
483
- timeout = 10000;
484
- startTime = Date.now();
485
- _a.label = 1;
486
- case 1:
487
- if (!(this.runId === undefined && Date.now() - startTime < timeout)) return [3 /*break*/, 3];
488
- return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, 250); })];
489
- case 2:
490
- _a.sent();
491
- return [3 /*break*/, 1];
492
- case 3:
493
- if (this.runId === undefined) {
494
- this.isDisabled = true;
495
- reject('Timeout while waiting for runId. Reporting is disabled.');
496
- }
497
- else {
498
- resolve(this.runId);
499
- }
500
- return [2 /*return*/];
501
- }
502
- });
503
- }); })];
499
+ var runId, attachmentsResult, _i, _a, attachment, attachments, _b, response, error_8;
500
+ return __generator(this, function (_c) {
501
+ switch (_c.label) {
502
+ case 0:
503
+ this._log(chalk_1.default.gray("Start upload attachments for test case [".concat(testCaseId, "]")));
504
+ return [4 /*yield*/, this.runIdPromise];
505
+ case 1:
506
+ runId = _c.sent();
507
+ attachmentsResult = [];
508
+ _i = 0, _a = testResult.attachments;
509
+ _c.label = 2;
510
+ case 2:
511
+ if (!(_i < _a.length)) return [3 /*break*/, 11];
512
+ attachment = _a[_i];
513
+ _c.label = 3;
514
+ case 3:
515
+ _c.trys.push([3, 9, , 10]);
516
+ if (!this.attachmentsType.includes(attachment.name)) return [3 /*break*/, 8];
517
+ if (!(0, fs_1.existsSync)(attachment.path)) return [3 /*break*/, 7];
518
+ attachments = {
519
+ attachmentType: 'GeneralAttachment',
520
+ fileName: "".concat(attachment.name, "-").concat(createGuid(), ".").concat(attachment.contentType.split('/')[1]),
521
+ stream: (0, fs_1.readFileSync)(attachment.path, { encoding: 'base64' })
522
+ };
523
+ if (!!this.testApi) return [3 /*break*/, 5];
524
+ _b = this;
525
+ return [4 /*yield*/, this.connection.getTestApi()];
526
+ case 4:
527
+ _b.testApi = _c.sent();
528
+ _c.label = 5;
529
+ case 5: return [4 /*yield*/, this.testApi.createTestResultAttachment(attachments, this.projectName, runId, caseId)];
530
+ case 6:
531
+ response = _c.sent();
532
+ if (!(response === null || response === void 0 ? void 0 : response.id))
533
+ throw new Error("Failed to upload attachment for test case [".concat(testCaseId, "]"));
534
+ attachmentsResult.push(response.url);
535
+ return [3 /*break*/, 8];
536
+ case 7: throw new Error("Attachment ".concat(attachment.path, " does not exist"));
537
+ case 8: return [3 /*break*/, 10];
538
+ case 9:
539
+ error_8 = _c.sent();
540
+ this._log(chalk_1.default.red(error_8.message));
541
+ return [3 /*break*/, 10];
542
+ case 10:
543
+ _i++;
544
+ return [3 /*break*/, 2];
545
+ case 11: return [2 /*return*/, attachmentsResult];
546
+ }
504
547
  });
505
548
  });
506
549
  };
507
- AzureDevOpsReporter.prototype.publishCaseResult = function (test, testResult) {
550
+ AzureDevOpsReporter.prototype._publishCaseResult = function (test, testResult) {
551
+ var _a, _b, _c, _d;
508
552
  return __awaiter(this, void 0, void 0, function () {
509
- var caseId;
510
- var _this = this;
511
- return __generator(this, function (_a) {
512
- caseId = this.getCaseIds(test);
513
- if (caseId === '')
514
- return [2 /*return*/];
515
- return [2 /*return*/, new Promise(function (resolved, reject) { return __awaiter(_this, void 0, void 0, function () {
516
- var testAlias, pointIds, results, _a, testCaseResult, err_3;
517
- var _this = this;
518
- var _b, _c, _d, _e;
519
- return __generator(this, function (_f) {
520
- switch (_f.label) {
521
- case 0:
522
- testAlias = "".concat(caseId, " - ").concat(test.title);
523
- this.resultsToBePublished.push(testAlias);
524
- this.log(chalk_1.default.gray("Start publishing: ".concat(test.title)));
525
- return [4 /*yield*/, this.getTestPointIdsByTCIds(this.planId, [parseInt(caseId, 10)]).catch(function (e) {
526
- _this.log(chalk_1.default.red("While getting test point ids, by test cases ids.\n ".concat(e)));
527
- _this.removePublished(testAlias);
528
- return;
529
- })];
530
- case 1:
531
- pointIds = _f.sent();
532
- if (!pointIds || !pointIds.length) {
533
- this.log(chalk_1.default.red("No test points found for test case [".concat(caseId, "]")));
534
- this.removePublished(testAlias);
535
- return [2 /*return*/];
536
- }
537
- _f.label = 2;
538
- case 2:
539
- _f.trys.push([2, 8, , 9]);
540
- results = [
541
- {
542
- testCase: { id: caseId },
543
- testPoint: { id: pointIds[0].toString() },
544
- testCaseTitle: test.title,
545
- outcome: Statuses[testResult.status],
546
- state: 'Completed',
547
- durationInMs: testResult.duration,
548
- errorMessage: testResult.error
549
- ? "".concat(test.title, ": ").concat((_c = (_b = testResult.error) === null || _b === void 0 ? void 0 : _b.message) === null || _c === void 0 ? void 0 : _c.replace(/\u001b\[.*?m/g, ''))
550
- : undefined,
551
- stackTrace: (_e = (_d = testResult.error) === null || _d === void 0 ? void 0 : _d.stack) === null || _e === void 0 ? void 0 : _e.replace(/\u001b\[.*?m/g, '')
552
- }
553
- ];
554
- if (!!this.testApi) return [3 /*break*/, 4];
555
- _a = this;
556
- return [4 /*yield*/, this.connection.getTestApi()];
557
- case 3:
558
- _a.testApi = _f.sent();
559
- _f.label = 4;
560
- case 4: return [4 /*yield*/, this.addReportingOverride(this.testApi).addTestResultsToTestRun(results, this.projectName, this.runId)];
561
- case 5:
562
- testCaseResult = _f.sent();
563
- if (!(this.uploadAttachments && testResult.attachments.length > 0)) return [3 /*break*/, 7];
564
- return [4 /*yield*/, this.uploadAttachmentsFunc(testResult, testCaseResult.result.value[0].id, caseId)];
565
- case 6:
566
- _f.sent();
567
- _f.label = 7;
568
- case 7:
569
- this.removePublished(testAlias);
570
- this.publishedResultsCount++;
571
- this.log(chalk_1.default.gray("Result published: ".concat(test.title)));
572
- resolved(testCaseResult);
573
- return [3 /*break*/, 9];
574
- case 8:
575
- err_3 = _f.sent();
576
- this.removePublished(testAlias);
577
- this.log(chalk_1.default.red(err_3));
578
- reject(err_3);
579
- return [3 /*break*/, 9];
580
- case 9: return [2 /*return*/];
553
+ var caseId, testAlias, runId, pointIds, results, _e, testCaseResult, error_9;
554
+ return __generator(this, function (_f) {
555
+ switch (_f.label) {
556
+ case 0:
557
+ caseId = this._getCaseIds(test);
558
+ if (!caseId)
559
+ return [2 /*return*/];
560
+ testAlias = "".concat(caseId, " - ").concat(test.title);
561
+ this.resultsToBePublished.push(testAlias);
562
+ _f.label = 1;
563
+ case 1:
564
+ _f.trys.push([1, 9, , 10]);
565
+ return [4 /*yield*/, this.runIdPromise];
566
+ case 2:
567
+ runId = _f.sent();
568
+ this._log(chalk_1.default.gray("Start publishing: ".concat(test.title)));
569
+ return [4 /*yield*/, this._getTestPointIdsByTCIds(this.planId, [parseInt(caseId, 10)])];
570
+ case 3:
571
+ pointIds = _f.sent();
572
+ if (!pointIds || !pointIds.length) {
573
+ this._removePublished(testAlias);
574
+ throw new Error("No test points found for test case [".concat(caseId, "]"));
575
+ }
576
+ results = [
577
+ {
578
+ testCase: { id: caseId },
579
+ testPoint: { id: String(pointIds[0]) },
580
+ testCaseTitle: test.title,
581
+ outcome: AzureTestStatuses[testResult.status],
582
+ state: 'Completed',
583
+ durationInMs: testResult.duration,
584
+ errorMessage: testResult.error
585
+ ? "".concat(test.title, ": ").concat((_b = (_a = testResult.error) === null || _a === void 0 ? void 0 : _a.message) === null || _b === void 0 ? void 0 : _b.replace(/\u001b\[.*?m/g, ''))
586
+ : undefined,
587
+ stackTrace: (_d = (_c = testResult.error) === null || _c === void 0 ? void 0 : _c.stack) === null || _d === void 0 ? void 0 : _d.replace(/\u001b\[.*?m/g, '')
581
588
  }
582
- });
583
- }); })];
589
+ ];
590
+ if (!!this.testApi) return [3 /*break*/, 5];
591
+ _e = this;
592
+ return [4 /*yield*/, this.connection.getTestApi()];
593
+ case 4:
594
+ _e.testApi = _f.sent();
595
+ _f.label = 5;
596
+ case 5: return [4 /*yield*/, this._addReportingOverride(this.testApi).addTestResultsToTestRun(results, this.projectName, runId)];
597
+ case 6:
598
+ testCaseResult = _f.sent();
599
+ if (!(testCaseResult === null || testCaseResult === void 0 ? void 0 : testCaseResult.result))
600
+ throw new Error("Failed to publish test result for test case [".concat(caseId, "]"));
601
+ if (!(this.uploadAttachments && testResult.attachments.length > 0)) return [3 /*break*/, 8];
602
+ return [4 /*yield*/, this._uploadAttachmentsFunc(testResult, testCaseResult.result.value[0].id, caseId)];
603
+ case 7:
604
+ _f.sent();
605
+ _f.label = 8;
606
+ case 8:
607
+ this._removePublished(testAlias);
608
+ this.publishedResultsCount++;
609
+ this._log(chalk_1.default.gray("Result published: ".concat(test.title)));
610
+ return [2 /*return*/, testCaseResult];
611
+ case 9:
612
+ error_9 = _f.sent();
613
+ this._removePublished(testAlias);
614
+ this._warning(chalk_1.default.red(error_9.message));
615
+ return [3 /*break*/, 10];
616
+ case 10: return [2 /*return*/];
617
+ }
584
618
  });
585
619
  });
586
620
  };
@@ -1 +1 @@
1
- {"version":3,"file":"playwright-azure-reporter.js","sourceRoot":"","sources":["../src/playwright-azure-reporter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,2DAA8C;AAM9C,gDAAyB;AACzB,yBAAiC;AAGjC,kDAA2B;AAE3B,SAAgB,UAAU;IACxB,OAAO,gBAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAChD,CAAC;AAFD,gCAEC;AAED,IAAM,QAAQ,GAAG;IACf,MAAM,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 "version": "1.2.0-beta.0",
4
4
  "description": "Playwright Azure Reporter",
5
5
  "main": "./dist/playwright-azure-reporter.js",
6
6
  "types": "./dist/playwright-azure-reporter.d.js",
@@ -13,7 +13,8 @@
13
13
  "prepublishOnly": "tsc",
14
14
  "dev": "npm run lint && tsc",
15
15
  "dev:watch": "nodemon --watch src --exec \"npm run build\"",
16
- "version": "conventional-changelog -p angular -i CHANGELOG.md -s && git add CHANGELOG.md"
16
+ "version": "conventional-changelog -p angular -i CHANGELOG.md -s && git add CHANGELOG.md",
17
+ "release": "conventional-github-releaser -p angular"
17
18
  },
18
19
  "keywords": [
19
20
  "playwright",
@@ -39,7 +40,7 @@
39
40
  "cryptojs": "^2.5.3"
40
41
  },
41
42
  "devDependencies": {
42
- "@playwright/test": "^1.23.4",
43
+ "@playwright/test": "^1.26.1",
43
44
  "@typescript-eslint/eslint-plugin": "^5.27.1",
44
45
  "@typescript-eslint/eslint-plugin-tslint": "^5.27.1",
45
46
  "@typescript-eslint/parser": "^5.27.1",
@@ -26,7 +26,14 @@ const config: PlaywrightTestConfig = {
26
26
  environment: 'AQA',
27
27
  testRunTitle: 'Playwright Test Run',
28
28
  uploadAttachments: true,
29
- // attachmentsType: ['screenshot'],
29
+ logging: true,
30
+ attachmentsType: ['screenshot'],
31
+ testRunConfig: {
32
+ owner: {
33
+ displayName: 'Alex Neo',
34
+ },
35
+ comment: 'Playwright Test Run',
36
+ }
30
37
  } as AzureReporterOptions
31
38
  ]
32
39
  ],