testit-adapter-codecept 3.4.7 → 3.4.10-TMS-5.5

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/README.md CHANGED
@@ -145,6 +145,8 @@ Description of methods:
145
145
  - `addAttachments` - uploading files in the autotest result
146
146
  - `addMessage` - information about autotest in the autotest result
147
147
 
148
+ The adapter automatically masks sensitive data passed through CodeceptJS `secret()` function in test steps to prevent exposure in reports and logs.
149
+
148
150
  ### Examples
149
151
 
150
152
  #### Simple test
@@ -67,14 +67,17 @@ class ResultBuilder {
67
67
  return attachments;
68
68
  }
69
69
  buildManySteps(steps) {
70
- return steps === null || steps === void 0 ? void 0 : steps.map((step) => ({
71
- title: `${step.name} ${(0, utils_1.humanize)(step.args).join(",")}`.trim(),
72
- outcome: step.status === "success" ? "Passed" : "Failed",
73
- description: "",
74
- startedOn: new Date(step.startedAt),
75
- duration: step.duration,
76
- completedOn: new Date(step.finishedAt),
77
- }));
70
+ return steps === null || steps === void 0 ? void 0 : steps.map((step) => {
71
+ const humanizedArgs = (0, utils_1.humanize)(step.args);
72
+ return {
73
+ title: `${step.name} ${humanizedArgs.join(",")}`.trim(),
74
+ outcome: step.status === "success" ? "Passed" : "Failed",
75
+ description: "",
76
+ startedOn: new Date(step.startedAt),
77
+ duration: step.duration,
78
+ completedOn: new Date(step.finishedAt),
79
+ };
80
+ });
78
81
  }
79
82
  reduceAfterOrBeforeSuites(suite) {
80
83
  return suite.reduce((array, suite) => { var _a; return [...array, ...this.buildManySteps((_a = suite === null || suite === void 0 ? void 0 : suite.steps) !== null && _a !== void 0 ? _a : [])]; }, []);
@@ -2,6 +2,20 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.humanize = void 0;
4
4
  function humanize(args) {
5
- return args.map(arg => typeof arg === 'object' ? JSON.stringify(arg) : arg);
5
+ return args.map((arg) => {
6
+ if (isSecretObject(arg)) {
7
+ return "****";
8
+ }
9
+ return typeof arg === "object" ? JSON.stringify(arg) : arg;
10
+ });
6
11
  }
7
12
  exports.humanize = humanize;
13
+ function isSecretObject(obj) {
14
+ if (typeof obj !== "object" || obj === null) {
15
+ return false;
16
+ }
17
+ if ("_secret" in obj) {
18
+ return true;
19
+ }
20
+ return false;
21
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testit-adapter-codecept",
3
- "version": "3.4.7",
3
+ "version": "3.4.10-TMS-5.5",
4
4
  "description": "Codecept adapter for Test IT",
5
5
  "keywords": [],
6
6
  "author": {
@@ -15,7 +15,7 @@
15
15
  "watch": "tsc -p tsconfig.json -w"
16
16
  },
17
17
  "dependencies": {
18
- "testit-js-commons": "3.4.7"
18
+ "testit-js-commons": "3.4.10-TMS-5.5"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@codeceptjs/configure": "^0.10.0",