@alex_neo/playwright-azure-reporter 1.20.0 → 1.20.2
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 +20 -0
- package/dist/logger.d.ts +1 -1
- package/dist/logger.js.map +1 -1
- package/dist/playwright-azure-reporter.js +76 -69
- package/dist/playwright-azure-reporter.js.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +9 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +11 -6
- package/.beta-release.json +0 -21
- package/.github/copilot-instructions.md +0 -178
- package/.github/workflows/beta-release.yml +0 -181
- package/.github/workflows/pr-beta-release.yml +0 -349
- package/.github/workflows/publish.yml +0 -206
- package/.github/workflows/tests.yml +0 -152
- package/.husky/pre-commit +0 -1
- package/.prettierrc +0 -5
- package/RELEASES.md +0 -151
- package/eslint.config.js +0 -68
- package/playwright.config.ts +0 -67
- package/tests/config/commonFixtures.ts +0 -182
- package/tests/config/serverFixtures.ts +0 -67
- package/tests/config/testserver/cert.pem +0 -28
- package/tests/config/testserver/index.ts +0 -267
- package/tests/config/testserver/key.pem +0 -52
- package/tests/config/utils.ts +0 -12
- package/tests/example.spec.ts +0 -32
- package/tests/examples/authType-examples.md +0 -159
- package/tests/examples/auto-mark-automated-examples.md +0 -443
- package/tests/reporter/assets/azure-reporter/azureAreas.js +0 -1172
- package/tests/reporter/assets/azure-reporter/azureCoreOptionsResponse.json +0 -135
- package/tests/reporter/assets/azure-reporter/azureHeaders.js +0 -42
- package/tests/reporter/assets/azure-reporter/azureLocationOptionsResponse.json +0 -35
- package/tests/reporter/assets/azure-reporter/azureTestOptionsResponse.json +0 -775
- package/tests/reporter/assets/azure-reporter/azureTestPlanOptionsResponse.json +0 -195
- package/tests/reporter/assets/azure-reporter/azureWorkItemTrackingOptionsResponse.json +0 -15
- package/tests/reporter/assets/azure-reporter/completeRunValidResponse.json +0 -27
- package/tests/reporter/assets/azure-reporter/createRunInvalidResponse.json +0 -9
- package/tests/reporter/assets/azure-reporter/createRunValidResponse.json +0 -25
- package/tests/reporter/assets/azure-reporter/existingTestRunResults3-7Response.json +0 -56
- package/tests/reporter/assets/azure-reporter/existingTestRunResults3Response.json +0 -29
- package/tests/reporter/assets/azure-reporter/getTestResultsByQueryResponse.json +0 -149
- package/tests/reporter/assets/azure-reporter/points1Response.json +0 -48
- package/tests/reporter/assets/azure-reporter/points3-7Response.json +0 -85
- package/tests/reporter/assets/azure-reporter/points33InvalidResponse.json +0 -6
- package/tests/reporter/assets/azure-reporter/points3Response.json +0 -46
- package/tests/reporter/assets/azure-reporter/points7Response.json +0 -46
- package/tests/reporter/assets/azure-reporter/pointsResponseMapper.js +0 -113
- package/tests/reporter/assets/azure-reporter/projectInvalidResponse.json +0 -9
- package/tests/reporter/assets/azure-reporter/projectValidResponse.json +0 -25
- package/tests/reporter/assets/azure-reporter/runResultsAttachmentsResponse.json +0 -4
- package/tests/reporter/assets/azure-reporter/testResultsByQueryResponseMapping.js +0 -147
- package/tests/reporter/assets/azure-reporter/testRunResults3-7ValidResponse.json +0 -33
- package/tests/reporter/assets/azure-reporter/testRunResults3ValidResponse.json +0 -19
- package/tests/reporter/assets/azure-reporter/testRunResults7ValidResponse.json +0 -19
- package/tests/reporter/assets/azure-reporter/testRunResultsMapper.js +0 -65
- package/tests/reporter/assets/azure-reporter/updatedTestRunResults3-7Response.json +0 -60
- package/tests/reporter/assets/azure-reporter/updatedTestRunResults3Response.json +0 -32
- package/tests/reporter/assets/custom-reporter-testResult.ts +0 -24
- package/tests/reporter/assets/custom-reporter-testRun.ts +0 -24
- package/tests/reporter/auth-handler-creation.spec.ts +0 -99
- package/tests/reporter/playwright.config.ts +0 -31
- package/tests/reporter/reporter-autoMarkTestCasesAsAutomated.spec.ts +0 -1624
- package/tests/reporter/reporter-build.spec.ts +0 -35
- package/tests/reporter/reporter-constructor.spec.ts +0 -1325
- package/tests/reporter/reporter-existingTestRun.spec.ts +0 -586
- package/tests/reporter/reporter-pagination.spec.ts +0 -289
- package/tests/reporter/reporter-publish-testResult.spec.ts +0 -1155
- package/tests/reporter/reporter-publish-testRun.spec.ts +0 -1308
- package/tests/reporter/reporter-publish-testRunADO.spec.ts +0 -599
- package/tests/reporter/reporter-retryAndFlaky.spec.ts +0 -339
- package/tests/reporter/reporter-testCaseSummary.spec.ts +0 -833
- package/tests/reporter/reporter-testPointMapper.spec.ts +0 -431
- package/tests/reporter/reporter-utils.spec.ts +0 -242
- package/tests/reporter/reporterPath.ts +0 -9
- package/tests/reporter/test-fixtures.ts +0 -296
- package/tests/reporter/token-refresh.spec.ts +0 -327
- package/tsconfig.json +0 -33
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
## v1.20.2
|
|
2
|
+
|
|
3
|
+
Released: 2026-08-07
|
|
4
|
+
|
|
5
|
+
## v1.20.1
|
|
6
|
+
|
|
7
|
+
Released: 2026-08-07
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
- fix(reporter): report test.fail() expected failures as Passed in Azure (2aeb932)
|
|
11
|
+
- fix(reporter): low-severity hardening — parseInt validation, gitignore, Promise pattern (L2/L3/L4/L8) (bd61c8a)
|
|
12
|
+
- fix(npm): add files whitelist and improve .npmignore (M3) (97ec66e)
|
|
13
|
+
- fix(reporter): fix VSSInterfaces import and Operation enum values (7d8a42c)
|
|
14
|
+
- fix(reporter): unify ANSI escape stripping via stripAnsi utility (M1) (cd9f7fb)
|
|
15
|
+
- fix(deps): upgrade eslint and typescript-eslint to latest, remove socksv5 (c0fa97f)
|
|
16
|
+
- fix(security): pin all GitHub Actions to immutable commit SHAs (H4) (24c227f)
|
|
17
|
+
- fix(security): address workflow security issues H1/H2/H3/L7 and jpeg extension bug (a44d428)
|
|
18
|
+
- fix(workflow): streamline beta release comment check by consolidating environment variables (29a456c)
|
|
19
|
+
- fix(ci): fix changelog generation and GitHub Release notes in publish workflow (b54f074)
|
|
20
|
+
|
|
1
21
|
# [1.20.0](https://github.com/alexneo2003/playwright-azure-reporter/compare/v1.19.1...v1.20.0) (2026-03-20)
|
|
2
22
|
|
|
3
23
|
|
package/dist/logger.d.ts
CHANGED
package/dist/logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAC1B,kDAA0B;AAE1B,MAAM,MAAM;IACF,aAAa,CAAS;IACtB,SAAS,CAAS;IAClB,SAAS,CAAU;IAE3B,YAAY,SAAkB;QAC5B,IAAI,CAAC,aAAa,GAAG,UAAU,CAAC;QAChC,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,KAAK,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,2CAA2C,CAAC;QAC/G,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAE3B,IAAI,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC;YACzC,eAAK,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC;IAEO,UAAU;QAChB,OAAO,OAAO,CAAC,GAAG,CAAC,iBAAiB,KAAK,MAAM,CAAC;IAClD,CAAC;IAGO,UAAU,CAAC,KAAa,EAAE,OAAe,EAAE,SAAkC,EAAE,KAAK,GAAG,KAAK;QAClG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,KAAK,EAAE,CAAC;YAChC,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;gBAChC,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;YAC7C,CAAC;YACD,IAAI,OAAO,GAAG,KAAK,CAAC;YACpB,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,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YACH,CAAC;YAED,IAAI,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC;gBACzC,eAAK,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAC/B,CAAC;QACH,CAAC;IACH,CAAC;IAED,IAAI,CAAC,OAAe,EAAE,KAAK,GAAG,KAAK;QACjC,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,eAAK,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACtD,CAAC;IAED,IAAI,CAAC,OAAe;QAClB,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,EAAE,eAAK,CAAC,MAAM,CAAC,CAAC;IACjD,CAAC;IAED,KAAK,CAAC,OAAe;QACnB,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,eAAK,CAAC,GAAG,CAAC,CAAC;IAC/C,CAAC;IAED,KAAK,CAAC,OAAgB;QACpB,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,OAAiB,EAAE,eAAK,CAAC,IAAI,CAAC,CAAC;IAC1D,CAAC;CACF;AAED,kBAAe,MAAM,CAAC"}
|
|
@@ -58,6 +58,11 @@ var EAzureTestStatuses;
|
|
|
58
58
|
})(EAzureTestStatuses || (EAzureTestStatuses = {}));
|
|
59
59
|
// eslint-disable-next-line
|
|
60
60
|
const attachmentTypesArray = ['screenshot', 'video', 'trace'];
|
|
61
|
+
function toError(error) {
|
|
62
|
+
if (error instanceof Error)
|
|
63
|
+
return error;
|
|
64
|
+
return new Error(String(error));
|
|
65
|
+
}
|
|
61
66
|
class AzureDevOpsReporter {
|
|
62
67
|
_logger;
|
|
63
68
|
_testApi;
|
|
@@ -256,7 +261,13 @@ class AzureDevOpsReporter {
|
|
|
256
261
|
}
|
|
257
262
|
this._orgUrl = options.orgUrl;
|
|
258
263
|
this._projectName = options.projectName;
|
|
259
|
-
|
|
264
|
+
const parsedPlanId = parseInt(options.planId.toString(), 10);
|
|
265
|
+
if (isNaN(parsedPlanId)) {
|
|
266
|
+
this._logger?.warn(`'planId' value "${options.planId}" is not a valid integer. Reporting is disabled.`);
|
|
267
|
+
this._setIsDisable(true);
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
this._planId = parsedPlanId;
|
|
260
271
|
this._token = options.token;
|
|
261
272
|
this._authType = options.authType || 'pat';
|
|
262
273
|
this._applicationIdURI = options.applicationIdURI;
|
|
@@ -302,7 +313,7 @@ class AzureDevOpsReporter {
|
|
|
302
313
|
return azdev.getHandlerFromToken(tokenResponse.token);
|
|
303
314
|
}
|
|
304
315
|
catch (error) {
|
|
305
|
-
this._logger?.error(`Failed to get token from Azure Managed Identity: ${error.message}`);
|
|
316
|
+
this._logger?.error(`Failed to get token from Azure Managed Identity: ${toError(error).message}`);
|
|
306
317
|
throw error;
|
|
307
318
|
}
|
|
308
319
|
}
|
|
@@ -350,7 +361,7 @@ class AzureDevOpsReporter {
|
|
|
350
361
|
}
|
|
351
362
|
}
|
|
352
363
|
catch (error) {
|
|
353
|
-
this._logger?.warn(`Failed to refresh token: ${error.message}`);
|
|
364
|
+
this._logger?.warn(`Failed to refresh token: ${toError(error).message}`);
|
|
354
365
|
}
|
|
355
366
|
}
|
|
356
367
|
}
|
|
@@ -374,7 +385,7 @@ class AzureDevOpsReporter {
|
|
|
374
385
|
}
|
|
375
386
|
}
|
|
376
387
|
catch (error) {
|
|
377
|
-
this._logger?.warn(`Failed to fetch configuration with ID ${configId}: ${error.message}`);
|
|
388
|
+
this._logger?.warn(`Failed to fetch configuration with ID ${configId}: ${toError(error).message}`);
|
|
378
389
|
}
|
|
379
390
|
}
|
|
380
391
|
this._configurationNames = configurationNames;
|
|
@@ -383,7 +394,7 @@ class AzureDevOpsReporter {
|
|
|
383
394
|
}
|
|
384
395
|
}
|
|
385
396
|
catch (error) {
|
|
386
|
-
this._logger?.error(`Failed to fetch configuration names: ${error.message}`);
|
|
397
|
+
this._logger?.error(`Failed to fetch configuration names: ${toError(error).message}`);
|
|
387
398
|
}
|
|
388
399
|
}
|
|
389
400
|
async onBegin() {
|
|
@@ -424,16 +435,17 @@ class AzureDevOpsReporter {
|
|
|
424
435
|
}
|
|
425
436
|
}
|
|
426
437
|
catch (error) {
|
|
427
|
-
|
|
428
|
-
|
|
438
|
+
const err = toError(error);
|
|
439
|
+
this._logger?.debug(err.message);
|
|
440
|
+
if (err.message.includes('401')) {
|
|
429
441
|
this._logger?.error('Failed to create test run. Check your token. Reporting is disabled.');
|
|
430
442
|
}
|
|
431
|
-
else if (
|
|
443
|
+
else if (err.message.includes('getaddrinfo ENOTFOUND')) {
|
|
432
444
|
this._logger?.error('Failed to create test run. Check your orgUrl. Reporting is disabled.');
|
|
433
445
|
}
|
|
434
446
|
else {
|
|
435
447
|
this._logger?.error('Failed to create test run. Reporting is disabled.');
|
|
436
|
-
this._logger?.error(
|
|
448
|
+
this._logger?.error(err.stack ?? '');
|
|
437
449
|
}
|
|
438
450
|
this._setIsDisable(true);
|
|
439
451
|
}
|
|
@@ -475,8 +487,8 @@ class AzureDevOpsReporter {
|
|
|
475
487
|
}
|
|
476
488
|
}
|
|
477
489
|
catch (error) {
|
|
478
|
-
this._logger?.error(`Failed to publish test result. \n ${error.message}`);
|
|
479
|
-
this._logger?.error(error.stack);
|
|
490
|
+
this._logger?.error(`Failed to publish test result. \n ${toError(error).message}`);
|
|
491
|
+
this._logger?.error(toError(error).stack ?? '');
|
|
480
492
|
}
|
|
481
493
|
}
|
|
482
494
|
async onEnd() {
|
|
@@ -486,7 +498,7 @@ class AzureDevOpsReporter {
|
|
|
486
498
|
await this._performOnEnd();
|
|
487
499
|
}
|
|
488
500
|
catch (error) {
|
|
489
|
-
this._logger?.error(`Error in onEnd: ${error.message}`);
|
|
501
|
+
this._logger?.error(`Error in onEnd: ${toError(error).message}`);
|
|
490
502
|
}
|
|
491
503
|
}
|
|
492
504
|
async _performOnEnd() {
|
|
@@ -571,7 +583,7 @@ class AzureDevOpsReporter {
|
|
|
571
583
|
}
|
|
572
584
|
}
|
|
573
585
|
catch (summaryError) {
|
|
574
|
-
this._logger?.error(`Error outputting test case summary: ${summaryError.message}`);
|
|
586
|
+
this._logger?.error(`Error outputting test case summary: ${toError(summaryError).message}`);
|
|
575
587
|
}
|
|
576
588
|
}
|
|
577
589
|
return;
|
|
@@ -596,7 +608,7 @@ class AzureDevOpsReporter {
|
|
|
596
608
|
}
|
|
597
609
|
}
|
|
598
610
|
catch (error) {
|
|
599
|
-
this._logger?.error(`Error on onEnd hook ${error}`);
|
|
611
|
+
this._logger?.error(`Error on onEnd hook ${String(error)}`);
|
|
600
612
|
}
|
|
601
613
|
// Always output test case summary if enabled, regardless of execution path
|
|
602
614
|
if (this._testCaseSummaryEnabled) {
|
|
@@ -611,7 +623,7 @@ class AzureDevOpsReporter {
|
|
|
611
623
|
}
|
|
612
624
|
}
|
|
613
625
|
catch (summaryError) {
|
|
614
|
-
this._logger?.error(`Error outputting test case summary: ${summaryError.message}`);
|
|
626
|
+
this._logger?.error(`Error outputting test case summary: ${toError(summaryError).message}`);
|
|
615
627
|
}
|
|
616
628
|
}
|
|
617
629
|
// Output auto-mark test cases as automated summary if enabled
|
|
@@ -659,12 +671,13 @@ class AzureDevOpsReporter {
|
|
|
659
671
|
if ((0, types_1.isRegExp)(obj))
|
|
660
672
|
return obj.toString();
|
|
661
673
|
const result = {};
|
|
662
|
-
|
|
674
|
+
const record = obj;
|
|
675
|
+
for (const key in record) {
|
|
663
676
|
if (keys.includes(key)) {
|
|
664
|
-
result[key] = this._anonymizeString(
|
|
677
|
+
result[key] = this._anonymizeString(String(record[key]));
|
|
665
678
|
}
|
|
666
679
|
else {
|
|
667
|
-
result[key] = this._anonymizeObject(
|
|
680
|
+
result[key] = this._anonymizeObject(record[key], keys);
|
|
668
681
|
}
|
|
669
682
|
}
|
|
670
683
|
return result;
|
|
@@ -818,7 +831,7 @@ class AzureDevOpsReporter {
|
|
|
818
831
|
}
|
|
819
832
|
}
|
|
820
833
|
catch (error) {
|
|
821
|
-
this._logger?.error(error.stack);
|
|
834
|
+
this._logger?.error(toError(error).stack ?? '');
|
|
822
835
|
this._setIsDisable(true);
|
|
823
836
|
}
|
|
824
837
|
}
|
|
@@ -838,7 +851,7 @@ class AzureDevOpsReporter {
|
|
|
838
851
|
throw new Error(`Project ${projectName} does not exist. Reporting is disabled.`);
|
|
839
852
|
}
|
|
840
853
|
catch (error) {
|
|
841
|
-
this._logger?.error(error.stack);
|
|
854
|
+
this._logger?.error(toError(error).stack ?? '');
|
|
842
855
|
this._setIsDisable(true);
|
|
843
856
|
}
|
|
844
857
|
}
|
|
@@ -1029,7 +1042,7 @@ class AzureDevOpsReporter {
|
|
|
1029
1042
|
}
|
|
1030
1043
|
}
|
|
1031
1044
|
catch (error) {
|
|
1032
|
-
this._logger?.error(error.stack);
|
|
1045
|
+
this._logger?.error(toError(error).stack ?? '');
|
|
1033
1046
|
}
|
|
1034
1047
|
return result;
|
|
1035
1048
|
}
|
|
@@ -1042,47 +1055,38 @@ class AzureDevOpsReporter {
|
|
|
1042
1055
|
* https://github.com/microsoft/azure-devops-node-api/issues/318#issuecomment-498802402
|
|
1043
1056
|
*/
|
|
1044
1057
|
api.addTestResultsToTestRun = function (results, projectName, runId) {
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
catch (error) {
|
|
1058
|
-
reject(error);
|
|
1059
|
-
}
|
|
1060
|
-
});
|
|
1058
|
+
const routeValues = {
|
|
1059
|
+
project: projectName,
|
|
1060
|
+
runId,
|
|
1061
|
+
};
|
|
1062
|
+
return this.vsoClient
|
|
1063
|
+
.getVersioningData('5.0-preview.5', 'Test', '4637d869-3a76-4468-8057-0bb02aa385cf', routeValues)
|
|
1064
|
+
.then((verData) => {
|
|
1065
|
+
const url = verData.requestUrl;
|
|
1066
|
+
const options = this.createRequestOptions('application/json', verData.apiVersion);
|
|
1067
|
+
return this.rest.create(url, results, options);
|
|
1068
|
+
})
|
|
1069
|
+
.then((res) => res);
|
|
1061
1070
|
};
|
|
1062
1071
|
return api;
|
|
1063
1072
|
};
|
|
1064
1073
|
// prettier-ignore
|
|
1065
1074
|
async _getPointsList(testPlanApi, project, planId, suiteId, testPointIds, testCaseId, continuationToken, returnIdentityRef, includePointDetails, isRecursive) {
|
|
1066
1075
|
testPlanApi.getPointsList = function (project, planId, suiteId, testPointIds, testCaseId, continuationToken, returnIdentityRef, includePointDetails, isRecursive) {
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
ret.continuationToken = res.headers['x-ms-continuationtoken'];
|
|
1080
|
-
}
|
|
1081
|
-
resolve(ret);
|
|
1082
|
-
}
|
|
1083
|
-
catch (error) {
|
|
1084
|
-
reject(error);
|
|
1076
|
+
const routeValues = { project, planId, suiteId };
|
|
1077
|
+
const queryValues = { testPointIds, testCaseId, continuationToken, returnIdentityRef, includePointDetails, isRecursive };
|
|
1078
|
+
return testPlanApi.vsoClient.getVersioningData('7.2-preview.2', 'testplan', '52df686e-bae4-4334-b0ee-b6cf4e6f6b73', routeValues, queryValues).then((verData) => {
|
|
1079
|
+
const url = verData.requestUrl;
|
|
1080
|
+
const options = this.createRequestOptions('application/json', verData.apiVersion);
|
|
1081
|
+
return this.rest.get(url, options);
|
|
1082
|
+
}).then((res) => {
|
|
1083
|
+
const ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestPoint, true);
|
|
1084
|
+
// Handle the continuation token
|
|
1085
|
+
const headers = res.headers;
|
|
1086
|
+
if (headers['x-ms-continuationtoken']) {
|
|
1087
|
+
ret.continuationToken = headers['x-ms-continuationtoken'];
|
|
1085
1088
|
}
|
|
1089
|
+
return ret;
|
|
1086
1090
|
});
|
|
1087
1091
|
};
|
|
1088
1092
|
const testPlanApiWithOverride = testPlanApi;
|
|
@@ -1102,7 +1106,7 @@ class AzureDevOpsReporter {
|
|
|
1102
1106
|
return points;
|
|
1103
1107
|
}
|
|
1104
1108
|
catch (error) {
|
|
1105
|
-
this._logger?.error(error.stack);
|
|
1109
|
+
this._logger?.error(toError(error).stack ?? '');
|
|
1106
1110
|
return [];
|
|
1107
1111
|
}
|
|
1108
1112
|
};
|
|
@@ -1125,7 +1129,7 @@ class AzureDevOpsReporter {
|
|
|
1125
1129
|
return allResults;
|
|
1126
1130
|
}
|
|
1127
1131
|
catch (error) {
|
|
1128
|
-
this._logger?.error(`Error fetching test results: ${error.stack}`);
|
|
1132
|
+
this._logger?.error(`Error fetching test results: ${toError(error).stack ?? ''}`);
|
|
1129
1133
|
return [];
|
|
1130
1134
|
}
|
|
1131
1135
|
};
|
|
@@ -1158,7 +1162,7 @@ class AzureDevOpsReporter {
|
|
|
1158
1162
|
}
|
|
1159
1163
|
}
|
|
1160
1164
|
catch (error) {
|
|
1161
|
-
this._logger?.debug(`Attempt ${attempt}: Cannot access file ${filePath} - ${error.message}`);
|
|
1165
|
+
this._logger?.debug(`Attempt ${attempt}: Cannot access file ${filePath} - ${toError(error).message}`);
|
|
1162
1166
|
}
|
|
1163
1167
|
if (attempt < maxRetries) {
|
|
1164
1168
|
const delay = baseDelay * Math.pow(2, attempt - 1); // Exponential backoff
|
|
@@ -1290,8 +1294,8 @@ class AzureDevOpsReporter {
|
|
|
1290
1294
|
}
|
|
1291
1295
|
}
|
|
1292
1296
|
catch (error) {
|
|
1293
|
-
this._logger?.error(`Failed to mark test case ${testCaseId} as automated: ${error.message}`);
|
|
1294
|
-
this._logger?.debug(error.stack);
|
|
1297
|
+
this._logger?.error(`Failed to mark test case ${testCaseId} as automated: ${toError(error).message}`);
|
|
1298
|
+
this._logger?.debug(toError(error).stack ?? '');
|
|
1295
1299
|
this._autoMarkStats.failed++;
|
|
1296
1300
|
}
|
|
1297
1301
|
}
|
|
@@ -1328,7 +1332,7 @@ class AzureDevOpsReporter {
|
|
|
1328
1332
|
};
|
|
1329
1333
|
}
|
|
1330
1334
|
catch (readError) {
|
|
1331
|
-
this._logger?.warn(`Failed to read attachment file ${attachment.path}: ${readError.message}, skipping upload`);
|
|
1335
|
+
this._logger?.warn(`Failed to read attachment file ${attachment.path}: ${toError(readError).message}, skipping upload`);
|
|
1332
1336
|
continue;
|
|
1333
1337
|
}
|
|
1334
1338
|
}
|
|
@@ -1350,7 +1354,7 @@ class AzureDevOpsReporter {
|
|
|
1350
1354
|
}
|
|
1351
1355
|
}
|
|
1352
1356
|
catch (error) {
|
|
1353
|
-
this._logger?.error(error.stack);
|
|
1357
|
+
this._logger?.error(toError(error).stack ?? '');
|
|
1354
1358
|
}
|
|
1355
1359
|
}
|
|
1356
1360
|
this._logger?.info(chalk_1.default.gray('Uploaded attachments'));
|
|
@@ -1386,7 +1390,7 @@ class AzureDevOpsReporter {
|
|
|
1386
1390
|
}
|
|
1387
1391
|
}
|
|
1388
1392
|
catch (error) {
|
|
1389
|
-
this._logger?.error(error.stack);
|
|
1393
|
+
this._logger?.error(toError(error).stack ?? '');
|
|
1390
1394
|
}
|
|
1391
1395
|
}
|
|
1392
1396
|
this._logger?.info(chalk_1.default.gray('Uploaded logs attachments'));
|
|
@@ -1405,6 +1409,9 @@ class AzureDevOpsReporter {
|
|
|
1405
1409
|
return EAzureTestStatuses['other'];
|
|
1406
1410
|
}
|
|
1407
1411
|
}
|
|
1412
|
+
else if (test.outcome() === 'expected') {
|
|
1413
|
+
return EAzureTestStatuses['passed'];
|
|
1414
|
+
}
|
|
1408
1415
|
else {
|
|
1409
1416
|
return EAzureTestStatuses[status];
|
|
1410
1417
|
}
|
|
@@ -1419,11 +1426,11 @@ class AzureDevOpsReporter {
|
|
|
1419
1426
|
durationInMs: testResult.duration,
|
|
1420
1427
|
errorMessage: testResult.error
|
|
1421
1428
|
? `${testCase.title}:\n\n${testResult.errors
|
|
1422
|
-
?.map((error, idx) => `ERROR #${idx + 1}:\n${
|
|
1429
|
+
?.map((error, idx) => `ERROR #${idx + 1}:\n${(0, utils_1.stripAnsi)(error.message)}`)
|
|
1423
1430
|
.join('\n\n')}`
|
|
1424
1431
|
: undefined,
|
|
1425
1432
|
stackTrace: `${testResult.errors
|
|
1426
|
-
?.map((error, idx) => `STACK #${idx + 1}:\n\n${
|
|
1433
|
+
?.map((error, idx) => `STACK #${idx + 1}:\n\n${(0, utils_1.stripAnsi)(error.stack)}`)
|
|
1427
1434
|
.join('\n\n\n')}`,
|
|
1428
1435
|
};
|
|
1429
1436
|
}
|
|
@@ -1507,7 +1514,7 @@ class AzureDevOpsReporter {
|
|
|
1507
1514
|
}
|
|
1508
1515
|
catch (error) {
|
|
1509
1516
|
this._removePublished(testCase.testAlias);
|
|
1510
|
-
this._logger?.error(error.stack);
|
|
1517
|
+
this._logger?.error(toError(error).stack ?? '');
|
|
1511
1518
|
}
|
|
1512
1519
|
}
|
|
1513
1520
|
async _publishTestRunResults(runId, testsResults) {
|
|
@@ -1688,7 +1695,7 @@ class AzureDevOpsReporter {
|
|
|
1688
1695
|
this._resolvePublishResults();
|
|
1689
1696
|
}
|
|
1690
1697
|
catch (error) {
|
|
1691
|
-
this._logger?.error(error.stack);
|
|
1698
|
+
this._logger?.error(toError(error).stack ?? '');
|
|
1692
1699
|
this._rejectPublishResults(error);
|
|
1693
1700
|
}
|
|
1694
1701
|
}
|
|
@@ -1754,7 +1761,7 @@ class AzureDevOpsReporter {
|
|
|
1754
1761
|
this._logger?.info(`Test case summary written to: ${this._testCaseSummaryOutputPath}`);
|
|
1755
1762
|
}
|
|
1756
1763
|
catch (error) {
|
|
1757
|
-
this._logger?.error(`Failed to write test case summary to file: ${error.message}`);
|
|
1764
|
+
this._logger?.error(`Failed to write test case summary to file: ${toError(error).message}`);
|
|
1758
1765
|
}
|
|
1759
1766
|
}
|
|
1760
1767
|
// Log summary to Azure reporter logging
|
|
@@ -1806,7 +1813,7 @@ class AzureDevOpsReporter {
|
|
|
1806
1813
|
}
|
|
1807
1814
|
}
|
|
1808
1815
|
catch (error) {
|
|
1809
|
-
this._logger?.error(`Failed to publish test case summary attachment: ${error.message}`);
|
|
1816
|
+
this._logger?.error(`Failed to publish test case summary attachment: ${toError(error).message}`);
|
|
1810
1817
|
}
|
|
1811
1818
|
}
|
|
1812
1819
|
}
|