testit-adapter-playwright 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 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
package/dist/labels.d.ts CHANGED
@@ -53,6 +53,10 @@ export declare class testit {
53
53
  private static addMetadataAttachment;
54
54
  static addAttachment(name: string, content: Buffer | string, options: ContentType | string | Pick<AttachmentOptions, "contentType">): Promise<void>;
55
55
  private static mapParams;
56
+ static workItemId(globalId: string): Promise<void>;
57
+ /**
58
+ * @deprecated Use workItemId with a single globalId instead.
59
+ */
56
60
  static workItemIds(value: string[]): Promise<void>;
57
61
  static displayName(value: string): Promise<void>;
58
62
  static externalId(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
  });
package/dist/reporter.js CHANGED
@@ -146,11 +146,16 @@ class TmsReporter {
146
146
  return false;
147
147
  }
148
148
  getDictionariesByTest(test) {
149
- const location = test.parent.title;
150
- if (location == undefined) {
149
+ const file = test.location?.file;
150
+ if (!file) {
151
151
  return [];
152
152
  }
153
- return location.split(path_1.default.sep);
153
+ const rootDir = this.config?.rootDir;
154
+ const relative = rootDir ? path_1.default.relative(rootDir, file) : file;
155
+ if (!relative || relative.startsWith("..")) {
156
+ return path_1.default.basename(file) ? [path_1.default.basename(file)] : [];
157
+ }
158
+ return relative.split(/[/\\]/).filter(Boolean);
154
159
  }
155
160
  async getAutotestData(test, result) {
156
161
  const autotestData = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testit-adapter-playwright",
3
- "version": "5.0.6",
3
+ "version": "5.0.7",
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.6"
43
+ "testit-js-commons": "5.0.7"
44
44
  },
45
45
  "files": [
46
46
  "dist"