testit-adapter-playwright 5.0.8-TMS-5.8 → 5.0.8

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,12 +137,14 @@ first-job:
137
137
  Methods can be used to specify information about autotest.
138
138
 
139
139
  Description of metadata methods:
140
- - `testit.workItemIds` - linking an autotest to a test case
140
+ - `testit.workItemId` - linking an autotest to a test case. Receives a single globalId
141
+ - `testit.workItemIds` - deprecated, use `testit.workItemId` instead
141
142
  - `testit.displayName` - name of the autotest in the Test IT system (can be replaced with documentation strings)
142
143
  - `testit.externalId` - ID of the autotest within the project in the Test IT System
143
144
  - `testit.title` - title in the autotest card
144
145
  - `testit.description` - description in the autotest card
145
146
  - `testit.labels` - labels in the autotest card
147
+ - `testit.layer` - test pyramid layer in the autotest card (source **Run**). Use `TestLayers` from `testit-js-commons` for recommended values (`E2E`, `UI`, `API`, `Contract`, `Integration`, `Component`, `Unit`), or any custom string
146
148
  - `testit.tags` - tags in the autotest card
147
149
  - `testit.links` - links in the autotest card
148
150
  - `testit.namespace` - directory in the TMS system (default - directory's name of test)
@@ -160,6 +162,7 @@ Description of methods:
160
162
  ```js
161
163
  import { test } from "@playwright/test";
162
164
  import { testit } from "testit-adapter-playwright";
165
+ import { TestLayers } from "testit-js-commons";
163
166
 
164
167
  test('All annotations', async () => {
165
168
  testit.externalId('all_annotations');
@@ -167,6 +170,7 @@ test('All annotations', async () => {
167
170
  testit.title('All annotations title');
168
171
  testit.description('Test with all annotations');
169
172
  testit.labels(['label1', 'label2']);
173
+ await testit.layer(TestLayers.API);
170
174
 
171
175
  testit.addMessage('This is a message');
172
176
  testit.addLinks([
package/dist/converter.js CHANGED
@@ -16,6 +16,7 @@ class Converter {
16
16
  title: autotestData.title,
17
17
  description: autotestData.description,
18
18
  labels: autotestData.labels,
19
+ layer: autotestData.layer,
19
20
  tags: autotestData.tags,
20
21
  links: autotestData.links,
21
22
  namespace: autotestData.namespace,
package/dist/labels.d.ts CHANGED
@@ -6,6 +6,7 @@ export interface MetadataMessage {
6
6
  title?: string;
7
7
  description?: string;
8
8
  labels?: Label[];
9
+ layer?: string;
9
10
  tags?: string[];
10
11
  links?: Link[];
11
12
  namespace?: string;
@@ -52,12 +53,17 @@ export declare class testit {
52
53
  private static addMetadataAttachment;
53
54
  static addAttachment(name: string, content: Buffer | string, options: ContentType | string | Pick<AttachmentOptions, "contentType">): Promise<void>;
54
55
  private static mapParams;
56
+ static workItemId(globalId: string): Promise<void>;
57
+ /**
58
+ * @deprecated Use workItemId with a single globalId instead.
59
+ */
55
60
  static workItemIds(value: string[]): Promise<void>;
56
61
  static displayName(value: string): Promise<void>;
57
62
  static externalId(value: string): Promise<void>;
58
63
  static title(value: string): Promise<void>;
59
64
  static description(value: string): Promise<void>;
60
65
  static labels(value: string[]): Promise<void>;
66
+ static layer(value: string): Promise<void>;
61
67
  static tags(value: string[]): Promise<void>;
62
68
  static links(value: Link[]): Promise<void>;
63
69
  static namespace(value: string): Promise<void>;
package/dist/labels.js CHANGED
@@ -106,7 +106,16 @@ class testit {
106
106
  return {};
107
107
  }
108
108
  }
109
+ static async workItemId(globalId) {
110
+ await this.addMetadataAttachment({
111
+ workItemIds: [globalId],
112
+ });
113
+ }
114
+ /**
115
+ * @deprecated Use workItemId with a single globalId instead.
116
+ */
109
117
  static async workItemIds(value) {
118
+ testit_js_commons_1.logger.warn("workItemIds is deprecated. Use workItemId with a single globalId instead.");
110
119
  await this.addMetadataAttachment({
111
120
  workItemIds: value,
112
121
  });
@@ -136,6 +145,11 @@ class testit {
136
145
  labels: value.map((label) => ({ name: label })),
137
146
  });
138
147
  }
148
+ static async layer(value) {
149
+ await this.addMetadataAttachment({
150
+ layer: value,
151
+ });
152
+ }
139
153
  static async tags(value) {
140
154
  await this.addMetadataAttachment({
141
155
  tags: value,
@@ -77,6 +77,9 @@ function applyMetadataTo(target, source) {
77
77
  if (source.labels) {
78
78
  target.labels = source.labels;
79
79
  }
80
+ if (source.layer) {
81
+ target.layer = source.layer;
82
+ }
80
83
  if (source.tags) {
81
84
  target.tags = source.tags;
82
85
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testit-adapter-playwright",
3
- "version": "5.0.8-TMS-5.8",
3
+ "version": "5.0.8",
4
4
  "description": "Playwright adapter for Test IT",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -40,7 +40,7 @@
40
40
  "prettier": "^3.0.1"
41
41
  },
42
42
  "dependencies": {
43
- "testit-js-commons": "5.0.8-TMS-5.8"
43
+ "testit-js-commons": "5.0.8"
44
44
  },
45
45
  "files": [
46
46
  "dist"