qase-javascript-commons 2.3.2 → 2.3.3
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 +4 -1
- package/changelog.md +6 -0
- package/dist/client/clientV1.js +1 -0
- package/dist/client/clientV2.js +1 -0
- package/dist/config/config-validation-schema.js +7 -0
- package/dist/env/env-enum.d.ts +2 -1
- package/dist/env/env-enum.js +1 -0
- package/dist/env/env-to-config.js +1 -0
- package/dist/env/env-type.d.ts +1 -0
- package/dist/env/env-validation-schema.js +7 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/models/config/TestOpsOptionsType.d.ts +1 -0
- package/dist/utils/signature.d.ts +8 -0
- package/dist/utils/signature.js +36 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -53,9 +53,11 @@ All configuration options are listed in the table below:
|
|
|
53
53
|
| Qase test run title | `testops.run.title` | `QASE_TESTOPS_RUN_TITLE` | `Automated run <Current date and time>` | No | Any string |
|
|
54
54
|
| Qase test run description | `testops.run.description` | `QASE_TESTOPS_RUN_DESCRIPTION` | `<Framework name> automated run` | No | Any string |
|
|
55
55
|
| Qase test run complete | `testops.run.complete` | `QASE_TESTOPS_RUN_COMPLETE` | `True` | | `True`, `False` |
|
|
56
|
+
| Array of tags to be added to the test run | `testops.run.tags` | `QASE_TESTOPS_RUN_TAGS` | `[]` | No | Array of strings |
|
|
56
57
|
| Qase test plan ID | `testops.plan.id` | `QASE_TESTOPS_PLAN_ID` | undefined | No | Any integer |
|
|
57
58
|
| Size of batch for sending test results | `testops.batch.size` | `QASE_TESTOPS_BATCH_SIZE` | `200` | No | Any integer |
|
|
58
59
|
| Enable defects for failed test cases | `testops.defect` | `QASE_TESTOPS_DEFECT` | `False` | No | `True`, `False` |
|
|
60
|
+
| Enable/disable attachment uploads | `testops.uploadAttachments` | `QASE_TESTOPS_UPLOAD_ATTACHMENTS` | `true` | No | `True`, `False` |
|
|
59
61
|
|
|
60
62
|
### Example `qase.config.json` config:
|
|
61
63
|
|
|
@@ -83,7 +85,8 @@ All configuration options are listed in the table below:
|
|
|
83
85
|
"run": {
|
|
84
86
|
"title": "Regress run",
|
|
85
87
|
"description": "Regress run description",
|
|
86
|
-
"complete": true
|
|
88
|
+
"complete": true,
|
|
89
|
+
"tags": ["tag1", "tag2"]
|
|
87
90
|
},
|
|
88
91
|
"defect": false,
|
|
89
92
|
"project": "<project_code>",
|
package/changelog.md
CHANGED
package/dist/client/clientV1.js
CHANGED
package/dist/client/clientV2.js
CHANGED
|
@@ -75,6 +75,7 @@ class ClientV2 extends clientV1_1.ClientV1 {
|
|
|
75
75
|
message: result.message,
|
|
76
76
|
fields: result.fields,
|
|
77
77
|
defect: this.config.defect ?? false,
|
|
78
|
+
signature: result.signature,
|
|
78
79
|
};
|
|
79
80
|
this.logger.logDebug(`Transformed result: ${JSON.stringify(model)}`);
|
|
80
81
|
return model;
|
package/dist/env/env-enum.d.ts
CHANGED
|
@@ -31,7 +31,8 @@ export declare enum EnvRunEnum {
|
|
|
31
31
|
id = "QASE_TESTOPS_RUN_ID",
|
|
32
32
|
title = "QASE_TESTOPS_RUN_TITLE",
|
|
33
33
|
description = "QASE_TESTOPS_RUN_DESCRIPTION",
|
|
34
|
-
complete = "QASE_TESTOPS_RUN_COMPLETE"
|
|
34
|
+
complete = "QASE_TESTOPS_RUN_COMPLETE",
|
|
35
|
+
tags = "QASE_TESTOPS_RUN_TAGS"
|
|
35
36
|
}
|
|
36
37
|
/**
|
|
37
38
|
* @enum {string}
|
package/dist/env/env-enum.js
CHANGED
|
@@ -39,6 +39,7 @@ var EnvRunEnum;
|
|
|
39
39
|
EnvRunEnum["title"] = "QASE_TESTOPS_RUN_TITLE";
|
|
40
40
|
EnvRunEnum["description"] = "QASE_TESTOPS_RUN_DESCRIPTION";
|
|
41
41
|
EnvRunEnum["complete"] = "QASE_TESTOPS_RUN_COMPLETE";
|
|
42
|
+
EnvRunEnum["tags"] = "QASE_TESTOPS_RUN_TAGS";
|
|
42
43
|
})(EnvRunEnum || (exports.EnvRunEnum = EnvRunEnum = {}));
|
|
43
44
|
/**
|
|
44
45
|
* @enum {string}
|
|
@@ -25,6 +25,7 @@ const envToConfig = (env) => ({
|
|
|
25
25
|
title: env[env_enum_1.EnvRunEnum.title],
|
|
26
26
|
description: env[env_enum_1.EnvRunEnum.description],
|
|
27
27
|
complete: env[env_enum_1.EnvRunEnum.complete],
|
|
28
|
+
tags: env[env_enum_1.EnvRunEnum.tags],
|
|
28
29
|
},
|
|
29
30
|
plan: {
|
|
30
31
|
id: env[env_enum_1.EnvPlanEnum.id],
|
package/dist/env/env-type.d.ts
CHANGED
|
@@ -72,6 +72,13 @@ exports.envValidationSchema = {
|
|
|
72
72
|
type: 'boolean',
|
|
73
73
|
nullable: true,
|
|
74
74
|
},
|
|
75
|
+
[env_enum_1.EnvRunEnum.tags]: {
|
|
76
|
+
type: 'array',
|
|
77
|
+
items: {
|
|
78
|
+
type: 'string',
|
|
79
|
+
},
|
|
80
|
+
nullable: true,
|
|
81
|
+
},
|
|
75
82
|
[env_enum_1.EnvPlanEnum.id]: {
|
|
76
83
|
type: 'number',
|
|
77
84
|
nullable: true,
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -24,4 +24,5 @@ __exportStar(require("./reporters"), exports);
|
|
|
24
24
|
__exportStar(require("./writer"), exports);
|
|
25
25
|
__exportStar(require("./utils/get-package-version"), exports);
|
|
26
26
|
__exportStar(require("./utils/mimeTypes"), exports);
|
|
27
|
+
__exportStar(require("./utils/signature"), exports);
|
|
27
28
|
__exportStar(require("./steps/step"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates a signature string from testops IDs, suites and parameters
|
|
3
|
+
* @param testopsIds - Array of testops IDs or null
|
|
4
|
+
* @param suites - Array of suite names
|
|
5
|
+
* @param parameters - Map of parameter names to values
|
|
6
|
+
* @returns Formatted signature string
|
|
7
|
+
*/
|
|
8
|
+
export declare const generateSignature: (testopsIds: number[] | null, suites: string[], parameters: Record<string, string>) => string;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateSignature = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Generates a signature string from testops IDs, suites and parameters
|
|
6
|
+
* @param testopsIds - Array of testops IDs or null
|
|
7
|
+
* @param suites - Array of suite names
|
|
8
|
+
* @param parameters - Map of parameter names to values
|
|
9
|
+
* @returns Formatted signature string
|
|
10
|
+
*/
|
|
11
|
+
const generateSignature = (testopsIds, suites, parameters) => {
|
|
12
|
+
const parts = [];
|
|
13
|
+
if (testopsIds && testopsIds.length > 0) {
|
|
14
|
+
parts.push(testopsIds.join('-'));
|
|
15
|
+
}
|
|
16
|
+
if (suites.length > 0) {
|
|
17
|
+
const processedSuites = suites
|
|
18
|
+
.map(suite => suite.trim())
|
|
19
|
+
.flatMap(suite => suite.split('::'))
|
|
20
|
+
.map(suite => suite.trim())
|
|
21
|
+
.flatMap(suite => suite.split('\t'))
|
|
22
|
+
.map(suite => suite.trim())
|
|
23
|
+
.map(suite => suite.replace(/\s+/g, '_'))
|
|
24
|
+
.map(suite => suite.toLowerCase())
|
|
25
|
+
.filter(suite => suite.length > 0);
|
|
26
|
+
parts.push(processedSuites.join('::'));
|
|
27
|
+
}
|
|
28
|
+
const paramsString = Object.entries(parameters)
|
|
29
|
+
.map(([key, value]) => `{'${key.toLowerCase()}':'${value.toLowerCase()}'}`)
|
|
30
|
+
.join('::');
|
|
31
|
+
if (paramsString) {
|
|
32
|
+
parts.push(paramsString);
|
|
33
|
+
}
|
|
34
|
+
return parts.join('::');
|
|
35
|
+
};
|
|
36
|
+
exports.generateSignature = generateSignature;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qase-javascript-commons",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.3",
|
|
4
4
|
"description": "Qase JS Reporters",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"license": "Apache-2.0",
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"ajv": "^8.12.0",
|
|
28
|
+
"async-mutex": "~0.5.0",
|
|
28
29
|
"chalk": "^4.1.2",
|
|
29
30
|
"env-schema": "^5.2.0",
|
|
30
31
|
"form-data": "^4.0.0",
|
|
@@ -35,8 +36,7 @@
|
|
|
35
36
|
"qase-api-client": "~1.0.1",
|
|
36
37
|
"qase-api-v2-client": "~1.0.1",
|
|
37
38
|
"strip-ansi": "^6.0.1",
|
|
38
|
-
"uuid": "^9.0.0"
|
|
39
|
-
"async-mutex": "~0.5.0"
|
|
39
|
+
"uuid": "^9.0.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@jest/globals": "^29.5.0",
|