testit-adapter-codecept 5.0.6 → 5.0.7

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
@@ -140,7 +140,8 @@ $ npx codeceptjs run --grep "$(cat tmp/filter.txt)"
140
140
  Methods can be used to specify information about autotest.
141
141
 
142
142
  Description of metadata methods:
143
- - `workItemIds` - a method that links autotests with manual tests. Receives the array of manual tests' IDs
143
+ - `workItemId` - a method that links an autotest with a manual test. Receives a single globalId
144
+ - `workItemIds` - deprecated, use `workItemId` instead
144
145
  - `displayName` - internal autotest name (used in Test IT)
145
146
  - `externalId` - unique internal autotest ID (used in Test IT)
146
147
  - `title` - autotest name specified in the autotest card. If not specified, the name from the displayName method is used
@@ -181,7 +182,7 @@ Scenario(
181
182
  hasInfo: true
182
183
  }
183
184
  ],
184
- workItemIds: ['1140']
185
+ workItemId: '1140'
185
186
  },
186
187
  ({ I }) => {
187
188
  I.amOnPage('https://github.com');
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TestsBuilder = void 0;
4
4
  const utils_1 = require("../common/utils");
5
+ const testit_js_commons_1 = require("testit-js-commons");
5
6
  class TestsBuilder {
6
7
  static build(test) {
7
8
  var _a, _b, _c, _d, _e, _f;
@@ -25,6 +26,7 @@ class TestsBuilder {
25
26
  externalId: (_f = (0, utils_1.useDefaultHash)(test)) !== null && _f !== void 0 ? _f : (0, utils_1.useCompositeHash)(test),
26
27
  namespace: config === null || config === void 0 ? void 0 : config.nameSpace,
27
28
  classname: config === null || config === void 0 ? void 0 : config.className,
29
+ workItemIds: resolveWorkItemIds(config),
28
30
  externalKey: test.title,
29
31
  };
30
32
  }
@@ -39,3 +41,13 @@ class TestsBuilder {
39
41
  }
40
42
  }
41
43
  exports.TestsBuilder = TestsBuilder;
44
+ function resolveWorkItemIds(config) {
45
+ var _a;
46
+ if ((_a = config === null || config === void 0 ? void 0 : config.workItemIds) === null || _a === void 0 ? void 0 : _a.length) {
47
+ testit_js_commons_1.logger.warn("workItemIds is deprecated. Use workItemId with a single globalId instead.");
48
+ }
49
+ if (config === null || config === void 0 ? void 0 : config.workItemId) {
50
+ return [config.workItemId];
51
+ }
52
+ return config === null || config === void 0 ? void 0 : config.workItemIds;
53
+ }
@@ -9,7 +9,11 @@ export declare namespace Origin {
9
9
  labels?: string[];
10
10
  layer?: string;
11
11
  tags?: string[];
12
- workItemIds?: [];
12
+ workItemId?: string;
13
+ /**
14
+ * @deprecated Use workItemId with a single globalId instead.
15
+ */
16
+ workItemIds?: string[];
13
17
  classname?: string;
14
18
  namespace?: string;
15
19
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testit-adapter-codecept",
3
- "version": "5.0.6",
3
+ "version": "5.0.7",
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": "5.0.6"
18
+ "testit-js-commons": "5.0.7"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@codeceptjs/configure": "^0.10.0",