qase-javascript-commons 2.2.12 → 2.2.14

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 CHANGED
@@ -1,3 +1,9 @@
1
+ # qase-javascript-commons@2.2.13
2
+
3
+ ## What's new
4
+
5
+ Enhanced error messages for 403 status code responses to provide clearer and more informative feedback.
6
+
1
7
  # qase-javascript-commons@2.2.12
2
8
 
3
9
  ## What's new
@@ -1,6 +1,7 @@
1
1
  export interface StepTextData {
2
2
  action: string;
3
3
  expected_result: string | null;
4
+ data: string | null;
4
5
  }
5
6
  export interface StepGherkinData {
6
7
  keyword: string;
@@ -26,6 +26,7 @@ class TestStepType {
26
26
  this.data = {
27
27
  action: '',
28
28
  expected_result: null,
29
+ data: null,
29
30
  };
30
31
  }
31
32
  else {
@@ -493,6 +493,12 @@ class TestOpsReporter extends abstract_reporter_1.AbstractReporter {
493
493
  resultStep.data.action = step.data.action;
494
494
  }
495
495
  }
496
+ if ('expected_result' in step.data && resultStep.data != undefined && step.data.expected_result != null) {
497
+ resultStep.data.expected_result = step.data.expected_result;
498
+ }
499
+ if ('data' in step.data && resultStep.data != undefined && step.data.data != null) {
500
+ resultStep.data.input_data = step.data.data;
501
+ }
496
502
  }
497
503
  if (step.step_type === models_1.StepType.GHERKIN) {
498
504
  if ('keyword' in step.data && resultStep.data != undefined) {
@@ -642,6 +648,10 @@ class TestOpsReporter extends abstract_reporter_1.AbstractReporter {
642
648
  if (error.response?.status === 404) {
643
649
  return new qase_error_1.QaseError(message + ': Not found.');
644
650
  }
651
+ if (error.response?.status === 403) {
652
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/restrict-template-expressions
653
+ return new qase_error_1.QaseError(`${message}: ${error.response?.data?.errorMessage}`);
654
+ }
645
655
  if (error.response?.status === 400 || error.response?.status === 422) {
646
656
  return new qase_error_1.QaseError(message + ': Bad request. Body: \n ' + JSON.stringify(model));
647
657
  }
@@ -57,6 +57,7 @@ class QaseStep {
57
57
  step.data = {
58
58
  action: this.name,
59
59
  expected_result: null,
60
+ data: null,
60
61
  };
61
62
  try {
62
63
  await body.call(this, this);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qase-javascript-commons",
3
- "version": "2.2.12",
3
+ "version": "2.2.14",
4
4
  "description": "Qase JS Reporters",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",