qase-javascript-commons 2.0.7 → 2.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/changelog.md +7 -1
- package/dist/config/config-validation-schema.js +1 -1
- package/dist/env/env-type.d.ts +1 -1
- package/dist/env/env-validation-schema.js +1 -1
- package/dist/options/options-type.d.ts +1 -1
- package/dist/qase.js +2 -2
- package/dist/reporters/testops-reporter.d.ts +1 -1
- package/dist/reporters/testops-reporter.js +14 -1
- package/package.json +1 -1
package/changelog.md
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
# qase-javascript-commons@2.0.8
|
|
2
|
+
|
|
3
|
+
## What's new
|
|
4
|
+
|
|
5
|
+
Fixed an issue with creating a test run with environment when the reporter ignored the `environment` parameter in the configuration.
|
|
6
|
+
|
|
1
7
|
# qase-javascript-commons@2.0.7
|
|
2
8
|
|
|
3
9
|
## What's new
|
|
4
10
|
|
|
5
|
-
Fixed an issue with creating a defect for failed tests when the
|
|
11
|
+
Fixed an issue with creating a defect for failed tests when the reporter ignored the `defect` parameter in the configuration.
|
|
6
12
|
|
|
7
13
|
# qase-javascript-commons@2.0.6
|
|
8
14
|
|
package/dist/env/env-type.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export type EnvType = {
|
|
|
5
5
|
[EnvEnum.mode]?: `${ModeEnum}`;
|
|
6
6
|
[EnvEnum.fallback]?: `${ModeEnum}`;
|
|
7
7
|
[EnvEnum.debug]?: boolean;
|
|
8
|
-
[EnvEnum.environment]?: string
|
|
8
|
+
[EnvEnum.environment]?: string;
|
|
9
9
|
[EnvEnum.captureLogs]?: boolean;
|
|
10
10
|
[EnvTestOpsEnum.project]?: string;
|
|
11
11
|
[EnvTestOpsEnum.uploadAttachments]?: boolean;
|
|
@@ -23,7 +23,7 @@ export type OptionsType = {
|
|
|
23
23
|
fallback?: `${ModeEnum}` | undefined;
|
|
24
24
|
captureLogs?: boolean | undefined;
|
|
25
25
|
debug?: boolean | undefined;
|
|
26
|
-
environment?: string |
|
|
26
|
+
environment?: string | undefined;
|
|
27
27
|
testops?: (RecursivePartial<TestOpsOptionsType> & AdditionalTestOpsOptionsType) | undefined;
|
|
28
28
|
report?: RecursivePartial<AdditionalReportOptionsType> | undefined;
|
|
29
29
|
};
|
package/dist/qase.js
CHANGED
|
@@ -279,12 +279,12 @@ class QaseReporter {
|
|
|
279
279
|
batch,
|
|
280
280
|
useV2,
|
|
281
281
|
defect,
|
|
282
|
-
}, apiClient,
|
|
282
|
+
}, apiClient, environment);
|
|
283
283
|
}
|
|
284
284
|
case options_1.ModeEnum.report: {
|
|
285
285
|
const localOptions = report.connections?.[writer_1.DriverEnum.local];
|
|
286
286
|
const writer = new writer_1.FsWriter(localOptions);
|
|
287
|
-
return new reporters_1.ReportReporter(this.logger, writer,
|
|
287
|
+
return new reporters_1.ReportReporter(this.logger, writer, environment, testops.run?.id);
|
|
288
288
|
}
|
|
289
289
|
case options_1.ModeEnum.off:
|
|
290
290
|
throw new disabled_exception_1.DisabledException();
|
|
@@ -97,7 +97,7 @@ export declare class TestOpsReporter extends AbstractReporter {
|
|
|
97
97
|
* @param {QaseApiInterface} api
|
|
98
98
|
* @param {number} environment
|
|
99
99
|
*/
|
|
100
|
-
constructor(logger: LoggerInterface, options: TestOpsOptionsType, api: QaseApiInterface, environment?:
|
|
100
|
+
constructor(logger: LoggerInterface, options: TestOpsOptionsType, api: QaseApiInterface, environment?: string);
|
|
101
101
|
/**
|
|
102
102
|
* @returns {Promise<void>}
|
|
103
103
|
*/
|
|
@@ -79,7 +79,20 @@ class TestOpsReporter extends abstract_reporter_1.AbstractReporter {
|
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
81
|
this.logger.logDebug('Create test run');
|
|
82
|
-
|
|
82
|
+
let environmentId;
|
|
83
|
+
if (this.environment != undefined) {
|
|
84
|
+
try {
|
|
85
|
+
const { data } = await this.api.environment.getEnvironments(this.projectCode, 100);
|
|
86
|
+
const env = data.result?.entities?.find((env) => env.slug === this.environment);
|
|
87
|
+
if (env) {
|
|
88
|
+
environmentId = env.id;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
throw new qase_error_1.QaseError('Cannot get environments', { cause: error });
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
const { result } = await this.createRun(this.run.title, this.run.description, environmentId);
|
|
83
96
|
if (!result?.id) {
|
|
84
97
|
throw new Error('Cannot create run.');
|
|
85
98
|
}
|