testit-adapter-playwright 3.3.1 → 3.4.1

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
@@ -18,9 +18,9 @@ npm install testit-adapter-playwright
18
18
  | API secret key [How to getting API secret key?](https://github.com/testit-tms/.github/tree/main/configuration#privatetoken) | privateToken | TMS_PRIVATE_TOKEN |
19
19
  | ID of project in TMS instance [How to getting project ID?](https://github.com/testit-tms/.github/tree/main/configuration#projectid) | projectId | TMS_PROJECT_ID |
20
20
  | ID of configuration in TMS instance [How to getting configuration ID?](https://github.com/testit-tms/.github/tree/main/configuration#configurationid) | configurationId | TMS_CONFIGURATION_ID |
21
- | ID of the created test run in TMS instance.<br/>It's necessary for **adapterMode** 0 or 1 | testRunId | TMS_TEST_RUN_ID |
21
+ | ID of the created test run in TMS instance.<br/>It's necessary for **adapterMode** 1 | testRunId | TMS_TEST_RUN_ID |
22
22
  | Parameter for specifying the name of test run in TMS instance (**It's optional**). If it is not provided, it is created automatically | testRunName | TMS_TEST_RUN_NAME |
23
- | Adapter mode. Default value - 0. The adapter supports following modes:<br/>0 - in this mode, the adapter filters tests by test run ID and configuration ID, and sends the results to the test run<br/>1 - in this mode, the adapter sends all results to the test run without filtering<br/>2 - in this mode, the adapter creates a new test run and sends results to the new test run | adapterMode | TMS_ADAPTER_MODE |
23
+ | Adapter mode. Default value - 1. The adapter supports following modes:<br>1 - in this mode, the adapter sends all results to the test run without filtering or [with filtering CLI](#run-with-filter)<br/>2 - in this mode, the adapter creates a new test run and sends results to the new test run | adapterMode | TMS_ADAPTER_MODE |
24
24
  | It enables/disables certificate validation (**It's optional**). Default value - true | certValidation | TMS_CERT_VALIDATION |
25
25
  | Mode of automatic creation test cases (**It's optional**). Default value - false. The adapter supports following modes:<br/>true - in this mode, the adapter will create a test case linked to the created autotest (not to the updated autotest)<br/>false - in this mode, the adapter will not create a test case | automaticCreationTestCases | TMS_AUTOMATIC_CREATION_TEST_CASES |
26
26
  | Mode of automatic updation links to test cases (**It's optional**). Default value - false. The adapter supports following modes:<br/>true - in this mode, the adapter will update links to test cases<br/>false - in this mode, the adapter will not update link to test cases | automaticUpdationLinksToTestCases | TMS_AUTOMATIC_UPDATION_LINKS_TO_TEST_CASES |
@@ -27,6 +27,7 @@ declare class TmsReporter implements Reporter {
27
27
  onEnd(): Promise<void>;
28
28
  addSkippedResults(): Promise<void>;
29
29
  printsToStdio(): boolean;
30
+ private getDictionariesByTest;
30
31
  private getAutotestData;
31
32
  private loadTest;
32
33
  }
package/dist/reporter.js CHANGED
@@ -13,10 +13,14 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
13
13
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
+ var __importDefault = (this && this.__importDefault) || function (mod) {
17
+ return (mod && mod.__esModule) ? mod : { "default": mod };
18
+ };
16
19
  Object.defineProperty(exports, "__esModule", { value: true });
17
20
  const testit_js_commons_1 = require("testit-js-commons");
18
21
  const converter_1 = require("./converter");
19
22
  const utils_1 = require("./utils");
23
+ const path_1 = __importDefault(require("path"));
20
24
  class TmsReporter {
21
25
  constructor(options) {
22
26
  this.testCache = new Array();
@@ -88,12 +92,26 @@ class TmsReporter {
88
92
  printsToStdio() {
89
93
  return false;
90
94
  }
95
+ getDictionariesByTest(test) {
96
+ const location = test.parent.title;
97
+ if (location == undefined) {
98
+ return [];
99
+ }
100
+ return location.split(path_1.default.sep);
101
+ }
91
102
  async getAutotestData(test, result) {
103
+ const dictionaries = this.getDictionariesByTest(test);
104
+ const classname = dictionaries[dictionaries.length - 1];
105
+ const namespace = dictionaries
106
+ .slice(0, -1)
107
+ .join(path_1.default.sep);
92
108
  const autotestData = {
93
109
  externalId: testit_js_commons_1.Utils.getHash(test.title),
94
110
  displayName: test.title,
95
111
  addAttachments: [],
96
112
  externalKey: test.title,
113
+ namespace: namespace,
114
+ classname: classname,
97
115
  };
98
116
  for (const attachment of result.attachments) {
99
117
  if (!attachment.body) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testit-adapter-playwright",
3
- "version": "3.3.1",
3
+ "version": "3.4.1",
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": "3.3.1"
43
+ "testit-js-commons": "3.4.1"
44
44
  },
45
45
  "files": [
46
46
  "dist"