testit-adapter-jest 2.2.2 → 2.2.4

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.
Files changed (2) hide show
  1. package/README.md +35 -16
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -12,21 +12,38 @@ npm install testit-adapter-jest
12
12
 
13
13
  ### Configuration
14
14
 
15
- | Description | File property | Environment variable | CLI argument |
16
- |----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------|-----------------------------------|-------------------------------|
17
- | Location of the TMS instance | url | TMS_URL | tmsUrl |
18
- | API secret key [How to getting API secret key?](https://github.com/testit-tms/.github/tree/main/configuration#privatetoken) | privateToken | TMS_PRIVATE_TOKEN | tmsPrivateToken |
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 | tmsProjectId |
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 | tmsConfigurationId |
21
- | ID of the created test run in TMS instance.<br/>It's necessary for **adapterMode** 0 or 1 | testRunId | TMS_TEST_RUN_ID | tmsTestRunId |
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 | tmsTestRunName |
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 | tmsAdapterMode |
24
- | It enables/disables certificate validation (**It's optional**). Default value - true | certValidation | TMS_CERT_VALIDATION | tmsCertValidation |
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 | tmsAutomaticCreationTestCases |
15
+ | Description | File property | Environment variable |
16
+ |----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------|--------------------------------------------|
17
+ | Location of the TMS instance | url | TMS_URL |
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
+ | 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
+ | 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 |
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 |
24
+ | It enables/disables certificate validation (**It's optional**). Default value - true | certValidation | TMS_CERT_VALIDATION |
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
+ | 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 |
26
27
 
27
28
  #### File
28
29
 
29
- 1. You need to set custom jest test environment, setup and teardown in `jest.config.js`.
30
+ 1. Create .env config or file config with default name tms.config.json in the root directory of the project
31
+
32
+ ```json
33
+ {
34
+ "url": "URL",
35
+ "privateToken": "USER_PRIVATE_TOKEN",
36
+ "projectId": "PROJECT_ID",
37
+ "configurationId": "CONFIGURATION_ID",
38
+ "testRunId": "TEST_RUN_ID",
39
+ "testRunName": "TEST_RUN_NAME",
40
+ "adapterMode": ADAPTER_MODE,
41
+ "automaticCreationTestCases": AUTOMATIC_CREATION_TEST_CASES,
42
+ "automaticUpdationLinksToTestCases": AUTOMATIC_UPDATION_LINKS_TO_TEST_CASES
43
+ }
44
+ ```
45
+
46
+ 2. You need to set custom setup and teardown in `jest.config.js`. Additionally, you can set adapter config in this file
30
47
 
31
48
  ```js
32
49
  module.exports = {
@@ -40,12 +57,13 @@ module.exports = {
40
57
  configurationId: 'CONFIGURATION_ID',
41
58
  testRunId: 'TEST_RUN_ID',
42
59
  adapterMode: ADAPTER_MODE,
43
- automaticCreationTestCases: AUTOMATIC_CREATION_TEST_CASES
60
+ automaticCreationTestCases: AUTOMATIC_CREATION_TEST_CASES,
61
+ automaticUpdationLinksToTestCases: AUTOMATIC_UPDATION_LINKS_TO_TEST_CASES
44
62
  },
45
63
  };
46
64
  ```
47
65
 
48
- 2. You also can extract environment configuration to external config and launch tests with `jest --config ./testit.jest.config.js`.
66
+ 3. You also can extract environment configuration to external config and launch tests with `jest --config ./testit.jest.config.js`.
49
67
 
50
68
  ```js
51
69
  // testit.jest.config.js
@@ -63,14 +81,15 @@ module.exports = {
63
81
  configurationId: 'CONFIGURATION_ID',
64
82
  testRunId: 'TEST_RUN_ID',
65
83
  adapterMode: ADAPTER_MODE,
66
- automaticCreationTestCases: AUTOMATIC_CREATION_TEST_CASES
84
+ automaticCreationTestCases: AUTOMATIC_CREATION_TEST_CASES,
85
+ automaticUpdationLinksToTestCases: AUTOMATIC_UPDATION_LINKS_TO_TEST_CASES
67
86
  },
68
87
  };
69
88
  ```
70
89
 
71
90
  #### Command line
72
91
 
73
- You can also specify options via cli arguments `jest --testEnvironment testit-adapter-jest --testEnvironmentOptions "{\"url\":\"URL\",\"privateToken\":\"USER_PRIVATE_TOKEN\",\"projectId\":\"PROJECT_ID\",\"configurationId\":\"CONFIGURATION_ID\",\"testRunId\":\"TEST_RUN_ID\",\"adapterMode\":ADAPTER_MODE,\"automaticCreationTestCases\":AUTOMATIC_CREATION_TEST_CASES}" --globalSetup testit-adapter-jest/dist/globalSetup.js --globalTeardown testit-adapter-jest/dist/globalTeardown.js`
92
+ You can also specify options via cli arguments `jest --testEnvironment testit-adapter-jest --testEnvironmentOptions "{\"url\":\"URL\",\"privateToken\":\"USER_PRIVATE_TOKEN\",\"projectId\":\"PROJECT_ID\",\"configurationId\":\"CONFIGURATION_ID\",\"testRunId\":\"TEST_RUN_ID\",\"adapterMode\":ADAPTER_MODE,\"automaticCreationTestCases\":AUTOMATIC_CREATION_TEST_CASES,\"automaticUpdationLinksToTestCases\":AUTOMATIC_UPDATION_LINKS_TO_TEST_CASES}" --globalSetup testit-adapter-jest/dist/globalSetup.js --globalTeardown testit-adapter-jest/dist/globalTeardown.js`
74
93
 
75
94
 
76
95
  ### Methods
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testit-adapter-jest",
3
- "version": "2.2.2",
3
+ "version": "2.2.4",
4
4
  "description": "Jest adapter for Test IT",
5
5
  "main": "dist/testitEnvironment.js",
6
6
  "scripts": {
@@ -16,7 +16,7 @@
16
16
  "license": "ISC",
17
17
  "dependencies": {
18
18
  "debug": "^4.3.4",
19
- "testit-js-commons": "~2.2.2"
19
+ "testit-js-commons": "~2.2.4"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@types/debug": "^4.1.7",