@alex_neo/playwright-azure-reporter 1.1.1 → 1.2.0-beta.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/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ # [1.2.0-beta.1](https://github.com/alexneo2003/playwright-azure-reporter/compare/v1.2.0-beta.0...v1.2.0-beta.1) (2022-10-13)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * optional configurationIds ([ffd01c3](https://github.com/alexneo2003/playwright-azure-reporter/commit/ffd01c34ea5a47c0075364ec286f46c233baa6f8))
7
+
8
+
9
+
10
+ # [1.2.0-beta.0](https://github.com/alexneo2003/playwright-azure-reporter/compare/v1.1.1...v1.2.0-beta.0) (2022-09-30)
11
+
12
+
13
+ ### Features
14
+
15
+ * Refactoring ([8f2545d](https://github.com/alexneo2003/playwright-azure-reporter/commit/8f2545d79cf9e3015498fcc01823d9ecbb47de8a))
16
+
17
+
18
+
1
19
  ## [1.1.1](https://github.com/alexneo2003/playwright-azure-reporter/compare/v1.1.0...v1.1.1) (2022-07-26)
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' | 'automated' | 'plan' | 'pointIds'>;
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,6 +74,7 @@ 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 */
66
78
  /* eslint-disable no-control-regex */
67
79
  var azdev = __importStar(require("azure-devops-node-api"));
68
80
  var chalk_1 = __importDefault(require("chalk"));
@@ -72,12 +84,14 @@ function createGuid() {
72
84
  return crypto_1.default.randomBytes(16).toString('hex');
73
85
  }
74
86
  exports.createGuid = createGuid;
75
- var Statuses = {
76
- passed: 'Passed',
77
- failed: 'Failed',
78
- skipped: 'Paused',
79
- timedOut: 'Failed'
80
- };
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 = {}));
81
95
  var attachmentTypesArray = [
82
96
  'screenshot',
83
97
  'video',
@@ -85,21 +99,30 @@ var attachmentTypesArray = [
85
99
  ];
86
100
  var AzureDevOpsReporter = /** @class */ (function () {
87
101
  function AzureDevOpsReporter(options) {
88
- if (options === void 0) { options = {}; }
102
+ var _this = this;
89
103
  this.publishedResultsCount = 0;
90
104
  this.resultsToBePublished = [];
91
105
  this.planId = 0;
92
- this.logging = true;
106
+ this.logging = false;
93
107
  this.isDisabled = false;
94
108
  this.testRunTitle = '';
95
109
  this.uploadAttachments = false;
96
110
  this.token = '';
97
- this.addReportingOverride = function (api) {
98
- // https://github.com/microsoft/azure-devops-node-api/issues/318#issuecomment-498802402
111
+ this.resolveRunId = function () { };
112
+ this.rejectRunId = function () { };
113
+ this.testRunConfig = {};
114
+ this._addReportingOverride = function (api) {
115
+ /**
116
+ * Override the default behavior of publishing test results to the test run.
117
+ * This is necessary because Microsoft Azure API documentation at version higher than '5.0-preview.5'
118
+ * has undocumented fields and they not implementing at 'azure-devops-node-api/TestApi' package.
119
+ * This function is downgraded the API version to '5.0-preview.5'.
120
+ * https://github.com/microsoft/azure-devops-node-api/issues/318#issuecomment-498802402
121
+ */
99
122
  api.addTestResultsToTestRun = function (results, projectName, runId) {
100
123
  var _this = this;
101
124
  return new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
102
- var routeValues, verData, url, options, res, err_1;
125
+ var routeValues, verData, url, options, res, error_1;
103
126
  return __generator(this, function (_a) {
104
127
  switch (_a.label) {
105
128
  case 0:
@@ -121,8 +144,8 @@ var AzureDevOpsReporter = /** @class */ (function () {
121
144
  resolve(res);
122
145
  return [3 /*break*/, 5];
123
146
  case 4:
124
- err_1 = _a.sent();
125
- reject(err_1);
147
+ error_1 = _a.sent();
148
+ reject(error_1);
126
149
  return [3 /*break*/, 5];
127
150
  case 5: return [2 /*return*/];
128
151
  }
@@ -131,463 +154,470 @@ var AzureDevOpsReporter = /** @class */ (function () {
131
154
  };
132
155
  return api;
133
156
  };
134
- this._options = options;
135
- this.orgUrl = this._options.orgUrl;
136
- this.projectName = this._options.projectName;
137
- this.environment = this._options.environment || undefined;
138
- this.planId = this._options.planId;
139
- this.logging = (typeof this._options.logging === 'undefined') ? true : this._options.logging;
140
- this.isDisabled = this._options.isDisabled || false;
141
- this.testRunTitle = "".concat(this.environment ? "[".concat(this.environment, "]:") : '', " ").concat(this._options.testRunTitle || 'Playwright Test Run') ||
142
- "".concat(this.environment ? "[".concat(this.environment, "]:") : '', "Test plan ").concat(this.planId);
143
- this.uploadAttachments = this._options.uploadAttachments || false;
144
- this.attachmentsType = this._options.attachmentsType;
145
- this.token = this._options.token;
146
- if (!this.orgUrl || this.orgUrl.length === 0) {
147
- this.log(chalk_1.default.yellow("'orgUrl' is not set. Reporting is disabled."));
157
+ this.runIdPromise = new Promise(function (resolve, reject) {
158
+ _this.resolveRunId = resolve;
159
+ _this.rejectRunId = reject;
160
+ }).then(function (runId) {
161
+ return runId;
162
+ }).catch(function (error) {
163
+ _this._warning(error);
164
+ _this.isDisabled = true;
165
+ });
166
+ this._validateOptions(options);
167
+ }
168
+ AzureDevOpsReporter.prototype._validateOptions = function (options) {
169
+ if (options === null || options === void 0 ? void 0 : options.isDisabled) {
148
170
  this.isDisabled = true;
149
171
  return;
150
172
  }
151
- if (!this.projectName || this.projectName.length === 0) {
152
- this.log(chalk_1.default.yellow("'projectName' is not set. Reporting is disabled."));
173
+ if (!(options === null || options === void 0 ? void 0 : options.orgUrl)) {
174
+ this._warning("'orgUrl' is not set. Reporting is disabled.");
153
175
  this.isDisabled = true;
154
176
  return;
155
177
  }
156
- if (!this.planId || this.planId === 0) {
157
- this.log(chalk_1.default.yellow("'planId' is not set. Reporting is disabled."));
178
+ if (!(options === null || options === void 0 ? void 0 : options.projectName)) {
179
+ this._warning("'projectName' is not set. Reporting is disabled.");
158
180
  this.isDisabled = true;
159
181
  return;
160
182
  }
161
- if (!this.token || this.token.length === 0) {
162
- this.log(chalk_1.default.yellow("'token' is not set. Reporting is disabled."));
183
+ if (!(options === null || options === void 0 ? void 0 : options.planId)) {
184
+ this._warning("'planId' is not set. Reporting is disabled.");
163
185
  this.isDisabled = true;
186
+ return;
164
187
  }
165
- if (this.uploadAttachments) {
166
- if (!this.attachmentsType) {
167
- this.log(chalk_1.default.yellow("'attachmentsType' is not set. Attachments Type will be set to 'screenshot' by default."));
188
+ if (!(options === null || options === void 0 ? void 0 : options.token)) {
189
+ this._warning("'token' is not set. Reporting is disabled.");
190
+ this.isDisabled = true;
191
+ return;
192
+ }
193
+ if (options === null || options === void 0 ? void 0 : options.uploadAttachments) {
194
+ if (!(options === null || options === void 0 ? void 0 : options.attachmentsType)) {
195
+ this._warning("'attachmentsType' is not set. Attachments Type will be set to 'screenshot' by default.");
168
196
  this.attachmentsType = ['screenshot'];
169
197
  }
198
+ else {
199
+ this.attachmentsType = options.attachmentsType;
200
+ }
170
201
  }
202
+ this.orgUrl = options.orgUrl;
203
+ this.projectName = options.projectName;
204
+ this.planId = options.planId;
205
+ this.logging = options.logging || false;
206
+ this.token = options.token;
207
+ this.environment = (options === null || options === void 0 ? void 0 : options.environment) || undefined;
208
+ this.testRunTitle = "".concat(this.environment ? "[".concat(this.environment, "]:") : '', " ").concat((options === null || options === void 0 ? void 0 : options.testRunTitle) || 'Playwright Test Run') ||
209
+ "".concat(this.environment ? "[".concat(this.environment, "]:") : '', "Test plan ").concat(this.planId);
210
+ this.uploadAttachments = (options === null || options === void 0 ? void 0 : options.uploadAttachments) || false;
171
211
  this.connection = new azdev.WebApi(this.orgUrl, azdev.getPersonalAccessTokenHandler(this.token));
172
- }
212
+ this.testRunConfig = (options === null || options === void 0 ? void 0 : options.testRunConfig) || {
213
+ configurationIds: [1],
214
+ };
215
+ };
173
216
  AzureDevOpsReporter.prototype.onBegin = function () {
174
217
  return __awaiter(this, void 0, void 0, function () {
175
- var _a;
176
- var _this = this;
218
+ var _a, run, error_2, parsedError;
177
219
  return __generator(this, function (_b) {
178
220
  switch (_b.label) {
179
221
  case 0:
180
222
  if (this.isDisabled)
181
223
  return [2 /*return*/];
224
+ _b.label = 1;
225
+ case 1:
226
+ _b.trys.push([1, 4, , 5]);
182
227
  _a = this;
183
228
  return [4 /*yield*/, this.connection.getTestApi()];
184
- case 1:
229
+ case 2:
185
230
  _a.testApi = _b.sent();
186
- this.createRun(this.testRunTitle).then(function (run) {
187
- if (run) {
188
- _this.runId = run.id;
189
- _this.log(chalk_1.default.green("Using run ".concat(_this.runId, " to publish test results")));
190
- }
191
- else {
192
- _this.isDisabled = true;
193
- }
194
- });
195
- return [2 /*return*/];
231
+ return [4 /*yield*/, this._createRun(this.testRunTitle)];
232
+ case 3:
233
+ run = _b.sent();
234
+ if (run === null || run === void 0 ? void 0 : run.id) {
235
+ this.resolveRunId(run.id);
236
+ this._log(chalk_1.default.green("Using run ".concat(run.id, " to publish test results")));
237
+ }
238
+ else {
239
+ this.isDisabled = true;
240
+ this.rejectRunId('Failed to create test run. Reporting is disabled.');
241
+ }
242
+ return [3 /*break*/, 5];
243
+ case 4:
244
+ error_2 = _b.sent();
245
+ this.isDisabled = true;
246
+ if (error_2.message.includes('401')) {
247
+ this._warning('Failed to create test run. Check your token. Reporting is disabled.');
248
+ }
249
+ else if (error_2.message.includes('getaddrinfo ENOTFOUND')) {
250
+ this._warning('Failed to create test run. Check your orgUrl. Reporting is disabled.');
251
+ }
252
+ else {
253
+ this._warning('Failed to create test run. Reporting is disabled.');
254
+ parsedError = JSON.parse(String(error_2.message.trim()));
255
+ this._warning((parsedError === null || parsedError === void 0 ? void 0 : parsedError.message) || error_2.message);
256
+ }
257
+ return [3 /*break*/, 5];
258
+ case 5: return [2 /*return*/];
196
259
  }
197
260
  });
198
261
  });
199
262
  };
200
263
  AzureDevOpsReporter.prototype.onTestEnd = function (test, testResult) {
201
264
  return __awaiter(this, void 0, void 0, function () {
202
- var _this = this;
265
+ var runId, error_3;
203
266
  return __generator(this, function (_a) {
204
267
  switch (_a.label) {
205
- case 0: return [4 /*yield*/, this.awaitForRunId().catch(function (e) {
206
- _this.log(chalk_1.default.red(e));
207
- })];
208
- case 1:
209
- _a.sent();
268
+ case 0:
210
269
  if (this.isDisabled)
211
270
  return [2 /*return*/];
212
- this.logTestItem(test, testResult);
213
- return [4 /*yield*/, this.publishCaseResult(test, testResult)];
271
+ _a.label = 1;
272
+ case 1:
273
+ _a.trys.push([1, 4, , 5]);
274
+ return [4 /*yield*/, this.runIdPromise];
214
275
  case 2:
276
+ runId = _a.sent();
277
+ if (!runId)
278
+ return [2 /*return*/];
279
+ this._logTestItem(test, testResult);
280
+ return [4 /*yield*/, this._publishCaseResult(test, testResult)];
281
+ case 3:
215
282
  _a.sent();
216
- return [2 /*return*/];
283
+ return [3 /*break*/, 5];
284
+ case 4:
285
+ error_3 = _a.sent();
286
+ this._warning("Failed to publish test result. \n ".concat(error_3.message));
287
+ return [3 /*break*/, 5];
288
+ case 5: return [2 /*return*/];
217
289
  }
218
290
  });
219
291
  });
220
292
  };
221
293
  AzureDevOpsReporter.prototype.onEnd = function () {
222
294
  return __awaiter(this, void 0, void 0, function () {
223
- var prevCount, runUpdate, _a, runUpdatedResponse, err_2;
224
- var _this = this;
295
+ var runId, prevCount, _a, runUpdatedResponse, error_4;
225
296
  return __generator(this, function (_b) {
226
297
  switch (_b.label) {
227
- case 0: return [4 /*yield*/, this.awaitForRunId().catch(function (e) {
228
- _this.log(chalk_1.default.red(e));
229
- })];
230
- case 1:
231
- _b.sent();
298
+ case 0:
232
299
  if (this.isDisabled)
233
300
  return [2 /*return*/];
234
- prevCount = this.resultsToBePublished.length;
235
- _b.label = 2;
301
+ _b.label = 1;
302
+ case 1:
303
+ _b.trys.push([1, 9, , 10]);
304
+ return [4 /*yield*/, this.runIdPromise];
236
305
  case 2:
237
- if (!(this.resultsToBePublished.length > 0)) return [3 /*break*/, 4];
306
+ runId = _b.sent();
307
+ prevCount = this.resultsToBePublished.length;
308
+ _b.label = 3;
309
+ case 3:
310
+ if (!(this.resultsToBePublished.length > 0)) return [3 /*break*/, 5];
238
311
  // need wait all results to be published
239
312
  if (prevCount > this.resultsToBePublished.length) {
240
- this.log(chalk_1.default.gray("Waiting for all results to be published. Remaining ".concat(this.resultsToBePublished.length, " results")));
313
+ this._log(chalk_1.default.gray("Waiting for all results to be published. Remaining ".concat(this.resultsToBePublished.length, " results")));
241
314
  prevCount--;
242
315
  }
243
316
  return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, 250); })];
244
- case 3:
245
- _b.sent();
246
- return [3 /*break*/, 2];
247
317
  case 4:
248
- if (this.publishedResultsCount === 0 && !this.runId) {
249
- this.log('No testcases were matched. Ensure that your tests are declared correctly.');
318
+ _b.sent();
319
+ return [3 /*break*/, 3];
320
+ case 5:
321
+ if (this.publishedResultsCount === 0 && !runId) {
322
+ this._log(chalk_1.default.gray('No testcases were matched. Ensure that your tests are declared correctly.'));
250
323
  return [2 /*return*/];
251
324
  }
252
- _b.label = 5;
253
- case 5:
254
- _b.trys.push([5, 9, , 10]);
255
- runUpdate = {
256
- state: 'Completed'
257
- };
258
325
  if (!!this.testApi) return [3 /*break*/, 7];
259
326
  _a = this;
260
327
  return [4 /*yield*/, this.connection.getTestApi()];
261
328
  case 6:
262
329
  _a.testApi = _b.sent();
263
330
  _b.label = 7;
264
- case 7: return [4 /*yield*/, this.testApi.updateTestRun(runUpdate, this.projectName, this.runId)];
331
+ case 7: return [4 /*yield*/, this.testApi.updateTestRun({ state: 'Completed' }, this.projectName, runId)];
265
332
  case 8:
266
333
  runUpdatedResponse = _b.sent();
267
- this.log(chalk_1.default.green("Run ".concat(this.runId, " - ").concat(runUpdatedResponse.state)));
334
+ this._log(chalk_1.default.green("Run ".concat(runId, " - ").concat(runUpdatedResponse.state)));
268
335
  return [3 /*break*/, 10];
269
336
  case 9:
270
- err_2 = _b.sent();
271
- this.log("Error on completing run ".concat(err_2));
337
+ error_4 = _b.sent();
338
+ this._warning(chalk_1.default.red("Error on completing run ".concat(error_4)));
272
339
  return [3 /*break*/, 10];
273
340
  case 10: return [2 /*return*/];
274
341
  }
275
342
  });
276
343
  });
277
344
  };
278
- AzureDevOpsReporter.prototype.log = function (message) {
279
- if (this.logging)
345
+ AzureDevOpsReporter.prototype.printsToStdio = function () {
346
+ return true;
347
+ };
348
+ AzureDevOpsReporter.prototype._log = function (message) {
349
+ if (this.logging) {
280
350
  console.log(chalk_1.default.magenta("azure: ".concat(message)));
351
+ }
281
352
  };
282
- AzureDevOpsReporter.prototype.getCaseIds = function (test) {
283
- var regexp = /\[([\d,]+)\]/;
284
- var results = regexp.exec(test.title);
353
+ AzureDevOpsReporter.prototype._warning = function (message) {
354
+ console.log("".concat(chalk_1.default.magenta('azure:'), " ").concat(chalk_1.default.yellow(message)));
355
+ };
356
+ AzureDevOpsReporter.prototype._getCaseIds = function (test) {
357
+ var results = /\[([\d,]+)\]/.exec(test.title);
285
358
  if (results && results.length === 2)
286
359
  return results[1];
287
- return '';
288
360
  };
289
- AzureDevOpsReporter.prototype.logTestItem = function (test, testResult) {
290
- var map = {
291
- failed: chalk_1.default.red("Test ".concat(test.title, " - ").concat(testResult.status)),
292
- passed: chalk_1.default.green("Test ".concat(test.title, " - ").concat(testResult.status)),
293
- skipped: chalk_1.default.blue("Test ".concat(test.title, " - ").concat(testResult.status)),
294
- pending: chalk_1.default.blue("Test ".concat(test.title, " - ").concat(testResult.status)),
295
- disabled: chalk_1.default.gray("Test ".concat(test.title, " - ").concat(testResult.status)),
296
- timedOut: chalk_1.default.gray("Test ".concat(test.title, " - ").concat(testResult.status))
297
- };
298
- if (testResult.status)
299
- this.log(map[testResult.status]);
361
+ AzureDevOpsReporter.prototype._logTestItem = function (test, testResult) {
362
+ switch (testResult.status) {
363
+ case 'passed':
364
+ this._log(chalk_1.default.green("".concat(test.title, " - ").concat(testResult.status)));
365
+ break;
366
+ case 'failed':
367
+ this._log(chalk_1.default.red("".concat(test.title, " - ").concat(testResult.status)));
368
+ break;
369
+ case 'timedOut':
370
+ this._log(chalk_1.default.yellow("".concat(test.title, " - ").concat(testResult.status)));
371
+ break;
372
+ case 'skipped':
373
+ this._log(chalk_1.default.yellow("".concat(test.title, " - ").concat(testResult.status)));
374
+ break;
375
+ case 'interrupted':
376
+ this._log(chalk_1.default.red("".concat(test.title, " - ").concat(testResult.status)));
377
+ break;
378
+ default:
379
+ this._log("".concat(test.title, " - ").concat(testResult.status));
380
+ break;
381
+ }
300
382
  };
301
- AzureDevOpsReporter.prototype.createRun = function (runName) {
383
+ AzureDevOpsReporter.prototype._createRun = function (runName) {
302
384
  return __awaiter(this, void 0, void 0, function () {
303
- var _this = this;
304
- return __generator(this, function (_a) {
305
- return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
306
- var runModel, _a, adTestRun, e_1;
307
- return __generator(this, function (_b) {
308
- switch (_b.label) {
309
- case 0:
310
- _b.trys.push([0, 4, , 5]);
311
- this.checkProject(this.projectName).catch(function (e) {
312
- reject(e);
313
- });
314
- runModel = {
315
- name: runName,
316
- automated: true,
317
- configurationIds: [1],
318
- plan: { id: "".concat(this.planId) }
319
- };
320
- if (!!this.testApi) return [3 /*break*/, 2];
321
- _a = this;
322
- return [4 /*yield*/, this.connection.getTestApi()];
323
- case 1:
324
- _a.testApi = _b.sent();
325
- _b.label = 2;
326
- case 2: return [4 /*yield*/, this.testApi.createTestRun(runModel, this.projectName)];
327
- case 3:
328
- adTestRun = _b.sent();
329
- resolve(adTestRun);
330
- return [3 /*break*/, 5];
331
- case 4:
332
- e_1 = _b.sent();
333
- reject(e_1);
334
- return [3 /*break*/, 5];
335
- case 5: return [2 /*return*/];
336
- }
337
- });
338
- }); }).catch(function (e) {
339
- _this.log(chalk_1.default.red("While creating test run.\n ".concat(e)));
340
- _this.isDisabled = true;
341
- throw e;
342
- })];
385
+ var isExists, runModel, _a, adTestRun, error_5;
386
+ return __generator(this, function (_b) {
387
+ switch (_b.label) {
388
+ case 0:
389
+ _b.trys.push([0, 7, , 8]);
390
+ return [4 /*yield*/, this._checkProject(this.projectName)];
391
+ case 1:
392
+ isExists = _b.sent();
393
+ if (!!isExists) return [3 /*break*/, 2];
394
+ return [2 /*return*/];
395
+ case 2:
396
+ runModel = __assign({ name: runName, automated: true, plan: { id: String(this.planId) } }, this.testRunConfig);
397
+ if (!!this.testApi) return [3 /*break*/, 4];
398
+ _a = this;
399
+ return [4 /*yield*/, this.connection.getTestApi()];
400
+ case 3:
401
+ _a.testApi = _b.sent();
402
+ _b.label = 4;
403
+ case 4: return [4 /*yield*/, this.testApi.createTestRun(runModel, this.projectName)];
404
+ case 5:
405
+ adTestRun = _b.sent();
406
+ if (adTestRun === null || adTestRun === void 0 ? void 0 : adTestRun.id)
407
+ return [2 /*return*/, adTestRun];
408
+ else
409
+ throw new Error('Failed to create test run');
410
+ _b.label = 6;
411
+ case 6: return [3 /*break*/, 8];
412
+ case 7:
413
+ error_5 = _b.sent();
414
+ this._warning(chalk_1.default.red(error_5.message));
415
+ this.isDisabled = true;
416
+ return [3 /*break*/, 8];
417
+ case 8: return [2 /*return*/];
418
+ }
343
419
  });
344
420
  });
345
421
  };
346
- AzureDevOpsReporter.prototype.removePublished = function (testAlias) {
422
+ AzureDevOpsReporter.prototype._removePublished = function (testAlias) {
347
423
  var resultIndex = this.resultsToBePublished.indexOf(testAlias);
348
424
  if (resultIndex !== -1)
349
425
  this.resultsToBePublished.splice(resultIndex, 1);
350
426
  };
351
- AzureDevOpsReporter.prototype.checkProject = function (projectName) {
427
+ AzureDevOpsReporter.prototype._checkProject = function (projectName) {
352
428
  return __awaiter(this, void 0, void 0, function () {
353
- var _this = this;
354
- return __generator(this, function (_a) {
355
- return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
356
- var _a, project, e_2;
357
- return __generator(this, function (_b) {
358
- switch (_b.label) {
359
- case 0:
360
- _b.trys.push([0, 4, , 5]);
361
- if (!!this.coreApi) return [3 /*break*/, 2];
362
- _a = this;
363
- return [4 /*yield*/, this.connection.getCoreApi()];
364
- case 1:
365
- _a.coreApi = _b.sent();
366
- _b.label = 2;
367
- case 2: return [4 /*yield*/, this.coreApi.getProject(projectName)];
368
- case 3:
369
- project = _b.sent();
370
- if (project)
371
- resolve(project);
372
- else
373
- reject("Project ".concat(projectName, " does not exist. Reporting is disabled."));
374
- return [3 /*break*/, 5];
375
- case 4:
376
- e_2 = _b.sent();
377
- reject(e_2);
378
- return [3 /*break*/, 5];
379
- case 5: return [2 /*return*/];
380
- }
381
- });
382
- }); }).catch(function (e) {
383
- _this.log(e);
384
- _this.isDisabled = true;
385
- })];
386
- });
387
- });
388
- };
389
- AzureDevOpsReporter.prototype.getTestPointIdsByTCIds = function (planId, testcaseIds) {
390
- return __awaiter(this, void 0, void 0, function () {
391
- var _this = this;
392
- return __generator(this, function (_a) {
393
- return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
394
- var pointsQuery, _a, pointsQueryResult, pointsIds_1, e_3;
395
- var _this = this;
396
- return __generator(this, function (_b) {
397
- switch (_b.label) {
398
- case 0:
399
- _b.trys.push([0, 4, , 5]);
400
- pointsQuery = {
401
- pointsFilter: { testcaseIds: testcaseIds }
402
- };
403
- if (!!this.testApi) return [3 /*break*/, 2];
404
- _a = this;
405
- return [4 /*yield*/, this.connection.getTestApi()];
406
- case 1:
407
- _a.testApi = _b.sent();
408
- _b.label = 2;
409
- case 2: return [4 /*yield*/, this.testApi.getPointsByQuery(pointsQuery, this.projectName)];
410
- case 3:
411
- pointsQueryResult = _b.sent();
412
- pointsIds_1 = [];
413
- if (pointsQueryResult.points) {
414
- pointsQueryResult.points.forEach(function (point) {
415
- if (point.testPlan && point.testPlan.id && parseInt(point.testPlan.id, 10) === planId)
416
- pointsIds_1.push(point.id);
417
- else
418
- 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."));
419
- });
420
- }
421
- resolve(pointsIds_1);
422
- return [3 /*break*/, 5];
423
- case 4:
424
- e_3 = _b.sent();
425
- this.log(chalk_1.default.red("While getting test points ids, by test cases ids.\n ".concat(e_3)));
426
- reject(e_3);
427
- return [3 /*break*/, 5];
428
- case 5: return [2 /*return*/];
429
- }
430
- });
431
- }); })];
429
+ var _a, project, error_6;
430
+ return __generator(this, function (_b) {
431
+ switch (_b.label) {
432
+ case 0:
433
+ _b.trys.push([0, 4, , 5]);
434
+ if (!!this.coreApi) return [3 /*break*/, 2];
435
+ _a = this;
436
+ return [4 /*yield*/, this.connection.getCoreApi()];
437
+ case 1:
438
+ _a.coreApi = _b.sent();
439
+ _b.label = 2;
440
+ case 2: return [4 /*yield*/, this.coreApi.getProject(projectName)];
441
+ case 3:
442
+ project = _b.sent();
443
+ if (project)
444
+ return [2 /*return*/, project];
445
+ else
446
+ throw new Error("Project ".concat(projectName, " does not exist. Reporting is disabled."));
447
+ return [3 /*break*/, 5];
448
+ case 4:
449
+ error_6 = _b.sent();
450
+ this._warning(chalk_1.default.red(error_6.message));
451
+ this.isDisabled = true;
452
+ return [3 /*break*/, 5];
453
+ case 5: return [2 /*return*/];
454
+ }
432
455
  });
433
456
  });
434
457
  };
435
- AzureDevOpsReporter.prototype.uploadAttachmentsFunc = function (testResult, caseId, testCaseId) {
458
+ AzureDevOpsReporter.prototype._getTestPointIdsByTCIds = function (planId, testcaseIds) {
436
459
  return __awaiter(this, void 0, void 0, function () {
437
- var _this = this;
438
- return __generator(this, function (_a) {
439
- switch (_a.label) {
460
+ var pointsIds, pointsQuery, _a, pointsQueryResult, error_7;
461
+ return __generator(this, function (_b) {
462
+ switch (_b.label) {
440
463
  case 0:
441
- this.log(chalk_1.default.gray("Start upload attachments for test case [".concat(testCaseId, "]")));
442
- return [4 /*yield*/, Promise.all(testResult.attachments.map(function (attachment) { return __awaiter(_this, void 0, void 0, function () {
443
- var attachments, _a, response;
444
- return __generator(this, function (_b) {
445
- switch (_b.label) {
446
- case 0:
447
- if (!this.attachmentsType.includes(attachment.name)) return [3 /*break*/, 6];
448
- if (!(0, fs_1.existsSync)(attachment.path)) return [3 /*break*/, 4];
449
- attachments = {
450
- attachmentType: 'GeneralAttachment',
451
- fileName: "".concat(attachment.name, "-").concat(createGuid(), ".").concat(attachment.contentType.split('/')[1]),
452
- stream: (0, fs_1.readFileSync)(attachment.path, { encoding: 'base64' })
453
- };
454
- if (!!this.testApi) return [3 /*break*/, 2];
455
- _a = this;
456
- return [4 /*yield*/, this.connection.getTestApi()];
457
- case 1:
458
- _a.testApi = _b.sent();
459
- _b.label = 2;
460
- case 2: return [4 /*yield*/, this.testApi.createTestResultAttachment(attachments, this.projectName, this.runId, caseId)];
461
- case 3:
462
- response = _b.sent();
463
- return [2 /*return*/, response.url];
464
- case 4:
465
- this.log(chalk_1.default.red("Attachment ".concat(attachment.path, " does not exist.")));
466
- return [2 /*return*/, ''];
467
- case 5: return [3 /*break*/, 7];
468
- case 6: return [2 /*return*/, ''];
469
- case 7: return [2 /*return*/];
470
- }
471
- });
472
- }); }))];
473
- case 1: return [2 /*return*/, _a.sent()];
464
+ pointsIds = [];
465
+ _b.label = 1;
466
+ case 1:
467
+ _b.trys.push([1, 5, , 6]);
468
+ pointsQuery = {
469
+ pointsFilter: { testcaseIds: testcaseIds }
470
+ };
471
+ if (!!this.testApi) return [3 /*break*/, 3];
472
+ _a = this;
473
+ return [4 /*yield*/, this.connection.getTestApi()];
474
+ case 2:
475
+ _a.testApi = _b.sent();
476
+ _b.label = 3;
477
+ case 3: return [4 /*yield*/, this.testApi.getPointsByQuery(pointsQuery, this.projectName)];
478
+ case 4:
479
+ pointsQueryResult = _b.sent();
480
+ if (pointsQueryResult.points) {
481
+ pointsQueryResult.points.forEach(function (point) {
482
+ if (point.testPlan && point.testPlan.id && parseInt(point.testPlan.id, 10) === planId) {
483
+ pointsIds.push(point.id);
484
+ }
485
+ });
486
+ }
487
+ if (pointsIds.length === 0) {
488
+ 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."));
489
+ }
490
+ return [2 /*return*/, pointsIds];
491
+ case 5:
492
+ error_7 = _b.sent();
493
+ this._warning(chalk_1.default.red(error_7.message));
494
+ return [3 /*break*/, 6];
495
+ case 6: return [2 /*return*/, pointsIds];
474
496
  }
475
497
  });
476
498
  });
477
499
  };
478
- AzureDevOpsReporter.prototype.awaitForRunId = function () {
500
+ AzureDevOpsReporter.prototype._uploadAttachmentsFunc = function (testResult, caseId, testCaseId) {
479
501
  return __awaiter(this, void 0, void 0, function () {
480
- var _this = this;
481
- return __generator(this, function (_a) {
482
- // need wait runId variable to be initialised in onBegin() hook
483
- if (this.isDisabled)
484
- return [2 /*return*/];
485
- return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
486
- var timeout, startTime;
487
- return __generator(this, function (_a) {
488
- switch (_a.label) {
489
- case 0:
490
- timeout = 10000;
491
- startTime = Date.now();
492
- _a.label = 1;
493
- case 1:
494
- if (!(this.runId === undefined && Date.now() - startTime < timeout)) return [3 /*break*/, 3];
495
- return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, 250); })];
496
- case 2:
497
- _a.sent();
498
- return [3 /*break*/, 1];
499
- case 3:
500
- if (this.runId === undefined) {
501
- this.isDisabled = true;
502
- reject('Timeout while waiting for runId. Reporting is disabled.');
503
- }
504
- else {
505
- resolve(this.runId);
506
- }
507
- return [2 /*return*/];
508
- }
509
- });
510
- }); })];
502
+ var runId, attachmentsResult, _i, _a, attachment, attachments, _b, response, error_8;
503
+ return __generator(this, function (_c) {
504
+ switch (_c.label) {
505
+ case 0:
506
+ this._log(chalk_1.default.gray("Start upload attachments for test case [".concat(testCaseId, "]")));
507
+ return [4 /*yield*/, this.runIdPromise];
508
+ case 1:
509
+ runId = _c.sent();
510
+ attachmentsResult = [];
511
+ _i = 0, _a = testResult.attachments;
512
+ _c.label = 2;
513
+ case 2:
514
+ if (!(_i < _a.length)) return [3 /*break*/, 11];
515
+ attachment = _a[_i];
516
+ _c.label = 3;
517
+ case 3:
518
+ _c.trys.push([3, 9, , 10]);
519
+ if (!this.attachmentsType.includes(attachment.name)) return [3 /*break*/, 8];
520
+ if (!(0, fs_1.existsSync)(attachment.path)) return [3 /*break*/, 7];
521
+ attachments = {
522
+ attachmentType: 'GeneralAttachment',
523
+ fileName: "".concat(attachment.name, "-").concat(createGuid(), ".").concat(attachment.contentType.split('/')[1]),
524
+ stream: (0, fs_1.readFileSync)(attachment.path, { encoding: 'base64' })
525
+ };
526
+ if (!!this.testApi) return [3 /*break*/, 5];
527
+ _b = this;
528
+ return [4 /*yield*/, this.connection.getTestApi()];
529
+ case 4:
530
+ _b.testApi = _c.sent();
531
+ _c.label = 5;
532
+ case 5: return [4 /*yield*/, this.testApi.createTestResultAttachment(attachments, this.projectName, runId, caseId)];
533
+ case 6:
534
+ response = _c.sent();
535
+ if (!(response === null || response === void 0 ? void 0 : response.id))
536
+ throw new Error("Failed to upload attachment for test case [".concat(testCaseId, "]"));
537
+ attachmentsResult.push(response.url);
538
+ return [3 /*break*/, 8];
539
+ case 7: throw new Error("Attachment ".concat(attachment.path, " does not exist"));
540
+ case 8: return [3 /*break*/, 10];
541
+ case 9:
542
+ error_8 = _c.sent();
543
+ this._log(chalk_1.default.red(error_8.message));
544
+ return [3 /*break*/, 10];
545
+ case 10:
546
+ _i++;
547
+ return [3 /*break*/, 2];
548
+ case 11: return [2 /*return*/, attachmentsResult];
549
+ }
511
550
  });
512
551
  });
513
552
  };
514
- AzureDevOpsReporter.prototype.publishCaseResult = function (test, testResult) {
553
+ AzureDevOpsReporter.prototype._publishCaseResult = function (test, testResult) {
554
+ var _a, _b, _c, _d;
515
555
  return __awaiter(this, void 0, void 0, function () {
516
- var caseId;
517
- var _this = this;
518
- return __generator(this, function (_a) {
519
- caseId = this.getCaseIds(test);
520
- if (caseId === '')
521
- return [2 /*return*/];
522
- return [2 /*return*/, new Promise(function (resolved, reject) { return __awaiter(_this, void 0, void 0, function () {
523
- var testAlias, pointIds, results, _a, testCaseResult, err_3;
524
- var _this = this;
525
- var _b, _c, _d, _e;
526
- return __generator(this, function (_f) {
527
- switch (_f.label) {
528
- case 0:
529
- testAlias = "".concat(caseId, " - ").concat(test.title);
530
- this.resultsToBePublished.push(testAlias);
531
- this.log(chalk_1.default.gray("Start publishing: ".concat(test.title)));
532
- return [4 /*yield*/, this.getTestPointIdsByTCIds(this.planId, [parseInt(caseId, 10)]).catch(function (e) {
533
- _this.log(chalk_1.default.red("While getting test point ids, by test cases ids.\n ".concat(e)));
534
- _this.removePublished(testAlias);
535
- return;
536
- })];
537
- case 1:
538
- pointIds = _f.sent();
539
- if (!pointIds || !pointIds.length) {
540
- this.log(chalk_1.default.red("No test points found for test case [".concat(caseId, "]")));
541
- this.removePublished(testAlias);
542
- return [2 /*return*/];
543
- }
544
- _f.label = 2;
545
- case 2:
546
- _f.trys.push([2, 8, , 9]);
547
- results = [
548
- {
549
- testCase: { id: caseId },
550
- testPoint: { id: pointIds[0].toString() },
551
- testCaseTitle: test.title,
552
- outcome: Statuses[testResult.status],
553
- state: 'Completed',
554
- durationInMs: testResult.duration,
555
- errorMessage: testResult.error
556
- ? "".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, ''))
557
- : undefined,
558
- stackTrace: (_e = (_d = testResult.error) === null || _d === void 0 ? void 0 : _d.stack) === null || _e === void 0 ? void 0 : _e.replace(/\u001b\[.*?m/g, '')
559
- }
560
- ];
561
- if (!!this.testApi) return [3 /*break*/, 4];
562
- _a = this;
563
- return [4 /*yield*/, this.connection.getTestApi()];
564
- case 3:
565
- _a.testApi = _f.sent();
566
- _f.label = 4;
567
- case 4: return [4 /*yield*/, this.addReportingOverride(this.testApi).addTestResultsToTestRun(results, this.projectName, this.runId)];
568
- case 5:
569
- testCaseResult = _f.sent();
570
- if (!(this.uploadAttachments && testResult.attachments.length > 0)) return [3 /*break*/, 7];
571
- return [4 /*yield*/, this.uploadAttachmentsFunc(testResult, testCaseResult.result.value[0].id, caseId)];
572
- case 6:
573
- _f.sent();
574
- _f.label = 7;
575
- case 7:
576
- this.removePublished(testAlias);
577
- this.publishedResultsCount++;
578
- this.log(chalk_1.default.gray("Result published: ".concat(test.title)));
579
- resolved(testCaseResult);
580
- return [3 /*break*/, 9];
581
- case 8:
582
- err_3 = _f.sent();
583
- this.removePublished(testAlias);
584
- this.log(chalk_1.default.red(err_3));
585
- reject(err_3);
586
- return [3 /*break*/, 9];
587
- case 9: return [2 /*return*/];
556
+ var caseId, testAlias, runId, pointIds, results, _e, testCaseResult, error_9;
557
+ return __generator(this, function (_f) {
558
+ switch (_f.label) {
559
+ case 0:
560
+ caseId = this._getCaseIds(test);
561
+ if (!caseId)
562
+ return [2 /*return*/];
563
+ testAlias = "".concat(caseId, " - ").concat(test.title);
564
+ this.resultsToBePublished.push(testAlias);
565
+ _f.label = 1;
566
+ case 1:
567
+ _f.trys.push([1, 9, , 10]);
568
+ return [4 /*yield*/, this.runIdPromise];
569
+ case 2:
570
+ runId = _f.sent();
571
+ this._log(chalk_1.default.gray("Start publishing: ".concat(test.title)));
572
+ return [4 /*yield*/, this._getTestPointIdsByTCIds(this.planId, [parseInt(caseId, 10)])];
573
+ case 3:
574
+ pointIds = _f.sent();
575
+ if (!pointIds || !pointIds.length) {
576
+ this._removePublished(testAlias);
577
+ throw new Error("No test points found for test case [".concat(caseId, "]"));
578
+ }
579
+ results = [
580
+ {
581
+ testCase: { id: caseId },
582
+ testPoint: { id: String(pointIds[0]) },
583
+ testCaseTitle: test.title,
584
+ outcome: AzureTestStatuses[testResult.status],
585
+ state: 'Completed',
586
+ durationInMs: testResult.duration,
587
+ errorMessage: testResult.error
588
+ ? "".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, ''))
589
+ : undefined,
590
+ stackTrace: (_d = (_c = testResult.error) === null || _c === void 0 ? void 0 : _c.stack) === null || _d === void 0 ? void 0 : _d.replace(/\u001b\[.*?m/g, '')
588
591
  }
589
- });
590
- }); })];
592
+ ];
593
+ if (!!this.testApi) return [3 /*break*/, 5];
594
+ _e = this;
595
+ return [4 /*yield*/, this.connection.getTestApi()];
596
+ case 4:
597
+ _e.testApi = _f.sent();
598
+ _f.label = 5;
599
+ case 5: return [4 /*yield*/, this._addReportingOverride(this.testApi).addTestResultsToTestRun(results, this.projectName, runId)];
600
+ case 6:
601
+ testCaseResult = _f.sent();
602
+ if (!(testCaseResult === null || testCaseResult === void 0 ? void 0 : testCaseResult.result))
603
+ throw new Error("Failed to publish test result for test case [".concat(caseId, "]"));
604
+ if (!(this.uploadAttachments && testResult.attachments.length > 0)) return [3 /*break*/, 8];
605
+ return [4 /*yield*/, this._uploadAttachmentsFunc(testResult, testCaseResult.result.value[0].id, caseId)];
606
+ case 7:
607
+ _f.sent();
608
+ _f.label = 8;
609
+ case 8:
610
+ this._removePublished(testAlias);
611
+ this.publishedResultsCount++;
612
+ this._log(chalk_1.default.gray("Result published: ".concat(test.title)));
613
+ return [2 /*return*/, testCaseResult];
614
+ case 9:
615
+ error_9 = _f.sent();
616
+ this._removePublished(testAlias);
617
+ this._warning(chalk_1.default.red(error_9.message));
618
+ return [3 /*break*/, 10];
619
+ case 10: return [2 /*return*/];
620
+ }
591
621
  });
592
622
  });
593
623
  };
@@ -1 +1 @@
1
- {"version":3,"file":"playwright-azure-reporter.js","sourceRoot":"","sources":["../src/playwright-azure-reporter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAqC;AACrC,2DAA8C;AAU9C,gDAAyB;AACzB,kDAA2B;AAC3B,yBAA6C;AAE7C,SAAgB,UA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C;wBACzD,sBAAO,cAAc,EAAC;;;wBAEtB,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;wBACjC,IAAI,CAAC,QAAQ,CAAC,eAAK,CAAC,GAAG,CAAC,OAAK,CAAC,OAAO,CAAC,CAAC,CAAC;;;;;;KAE3C;IACH,0BAAC;AAAD,CAAC,AAjYD,IAiYC;AAED,kBAAe,mBAAmB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alex_neo/playwright-azure-reporter",
3
- "version": "1.1.1",
3
+ "version": "1.2.0-beta.1",
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
  ],