testit-adapter-cypress 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
@@ -137,7 +137,8 @@ first-job:
137
137
  Methods can be used to specify information about autotest.
138
138
 
139
139
  Description of methods:
140
- - `tms.addWorkItemIds` - a dynamic method that links autotests with manual tests. Receives the array of manual tests' IDs
140
+ - `tms.addWorkItemId` - a dynamic method that links an autotest with a manual test. Receives a single globalId
141
+ - `tms.addWorkItemIds` - deprecated, use `tms.addWorkItemId` instead
141
142
  - `tms.addDisplayName` - a dynamic method for adding internal autotest name (used in Test IT)
142
143
  - `tms.addTitle` - a dynamic method for adding autotest name specified in the autotest card. If not specified, the name from the displayName method is used
143
144
  - `tms.addDescription` - a dynamic method for adding autotest description specified in the autotest card
@@ -163,7 +164,7 @@ describe('example to-do app', () => {
163
164
  it('displays two todo items by default', () => {
164
165
  const tms = getTestRuntime();
165
166
 
166
- tms.addWorkItemIds('123', '321');
167
+ tms.addWorkItemId('123');
167
168
  tms.addDisplayName('display name');
168
169
  tms.addTitle('test title');
169
170
  tms.addDescription('Test description');
@@ -9,6 +9,10 @@ declare class TmsCypressTestRuntime implements TestRuntime {
9
9
  addLayer(layer: string): PromiseLike<void>;
10
10
  addTags(...tags: string[]): PromiseLike<void>;
11
11
  addLinks(...links: Link[]): PromiseLike<void>;
12
+ addWorkItemId(globalId: string): PromiseLike<void>;
13
+ /**
14
+ * @deprecated Use addWorkItemId with a single globalId instead.
15
+ */
12
16
  addWorkItemIds(...workItemIds: string[]): PromiseLike<void>;
13
17
  addParameter(name: string, value: string): PromiseLike<void>;
14
18
  addDescription(description: string): PromiseLike<void>;
@@ -51,7 +51,19 @@ class TmsCypressTestRuntime {
51
51
  },
52
52
  });
53
53
  }
54
+ addWorkItemId(globalId) {
55
+ return __classPrivateFieldGet(this, _TmsCypressTestRuntime_instances, "m", _TmsCypressTestRuntime_enqueueMessageAsync).call(this, {
56
+ type: "metadata",
57
+ data: {
58
+ workItemId: globalId,
59
+ },
60
+ });
61
+ }
62
+ /**
63
+ * @deprecated Use addWorkItemId with a single globalId instead.
64
+ */
54
65
  addWorkItemIds(...workItemIds) {
66
+ console.warn("addWorkItemIds is deprecated. Use addWorkItemId with a single globalId instead.");
55
67
  return __classPrivateFieldGet(this, _TmsCypressTestRuntime_instances, "m", _TmsCypressTestRuntime_enqueueMessageAsync).call(this, {
56
68
  type: "metadata",
57
69
  data: {
@@ -17,6 +17,10 @@ export interface TestRuntime {
17
17
  addLayer(layer: string): PromiseLike<void>;
18
18
  addTags(...tags: string[]): PromiseLike<void>;
19
19
  addLinks(...links: Link[]): PromiseLike<void>;
20
+ addWorkItemId(globalId: string): PromiseLike<void>;
21
+ /**
22
+ * @deprecated Use addWorkItemId with a single globalId instead.
23
+ */
20
24
  addWorkItemIds(...workItemIds: string[]): PromiseLike<void>;
21
25
  addParameter(name: string, value: string): PromiseLike<void>;
22
26
  addDescription(markdown: string): PromiseLike<void>;
@@ -14,6 +14,7 @@ exports.noopRuntime = {
14
14
  addLayer: () => noop,
15
15
  addTags: () => noop,
16
16
  addLinks: () => noop,
17
+ addWorkItemId: () => noop,
17
18
  addWorkItemIds: () => noop,
18
19
  addParameter: () => noop,
19
20
  addDescription: () => noop,
@@ -178,6 +178,7 @@ export type RuntimeMetadataMessage = RuntimeMessageBase<"metadata"> & {
178
178
  links?: Link[];
179
179
  tags?: string[];
180
180
  workItemIds?: string[];
181
+ workItemId?: string;
181
182
  parameters?: Parameter[];
182
183
  description?: string;
183
184
  displayName?: string;
package/dist/reporter.js CHANGED
@@ -413,8 +413,12 @@ class TmsCypress {
413
413
  current.tags.push(...data.tags);
414
414
  }
415
415
  if (data.workItemIds?.length) {
416
+ console.warn("addWorkItemIds is deprecated. Use addWorkItemId with a single globalId instead.");
416
417
  current.workItemIds.push(...data.workItemIds);
417
418
  }
419
+ if (data.workItemId) {
420
+ current.workItemIds = [data.workItemId];
421
+ }
418
422
  if (data.links?.length) {
419
423
  current.links.push(...data.links);
420
424
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testit-adapter-cypress",
3
- "version": "5.0.6",
3
+ "version": "5.0.7",
4
4
  "description": "Cypress adapter for Test IT",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -42,7 +42,7 @@
42
42
  "@types/node": "^20.14.2"
43
43
  },
44
44
  "dependencies": {
45
- "testit-js-commons": "5.0.6"
45
+ "testit-js-commons": "5.0.7"
46
46
  },
47
47
  "files": [
48
48
  "dist"