qase-javascript-commons 2.5.10 → 2.6.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/changelog.md CHANGED
@@ -1,3 +1,17 @@
1
+ # qase-javascript-commons@2.6.1
2
+
3
+ ## Bug fixes
4
+
5
+ - Fixed Cypress test failures being classified as `invalid` instead of `failed`. Cypress uses retry-ability (`Timed out retrying after Nms: ...`) and command syntax (`cy.click() failed`, `cy.wait() timed out`) that don't contain the word `expect`, so genuine UI/command failures previously fell through to the timeout catch-all and were mislabeled as environment errors. `cy.request()` with infrastructure-level errors (e.g. `ECONNREFUSED`) continues to be classified as `invalid`.
6
+
7
+ # qase-javascript-commons@2.6.0
8
+
9
+ ## What's new
10
+
11
+ - Added `tags: string[]` field to `TestResultType` domain model for tag support.
12
+ - Tags are mapped to `fields.tags` as a comma-separated string when sending results to API v2.
13
+ - Tags are included in report serialization output.
14
+
1
15
  # qase-javascript-commons@2.5.10
2
16
 
3
17
  ## What's new
@@ -140,6 +140,12 @@ class ClientV2 extends clientV1_1.ClientV1 {
140
140
  defect: this.config.defect ?? false,
141
141
  signature: result.signature,
142
142
  };
143
+ if (result.tags.length > 0) {
144
+ model.fields = {
145
+ ...model.fields,
146
+ tags: [...new Set(result.tags)].join(','),
147
+ };
148
+ }
143
149
  this.logger.logDebug(`Transformed result: ${JSON.stringify(model)}`);
144
150
  return model;
145
151
  }
@@ -28,6 +28,7 @@ export declare class TestResultType {
28
28
  relations: Relation | null;
29
29
  muted: boolean;
30
30
  message: string | null;
31
+ tags: string[];
31
32
  preparedAttachments?: string[];
32
33
  constructor(title: string);
33
34
  /**
@@ -24,6 +24,7 @@ class TestResultType {
24
24
  relations;
25
25
  muted;
26
26
  message;
27
+ tags;
27
28
  preparedAttachments;
28
29
  constructor(title) {
29
30
  this.id = '';
@@ -42,6 +43,7 @@ class TestResultType {
42
43
  this.relations = null;
43
44
  this.muted = false;
44
45
  this.message = null;
46
+ this.tags = [];
45
47
  this.preparedAttachments = [];
46
48
  }
47
49
  /**
@@ -192,6 +192,7 @@ class ReportReporter extends abstract_reporter_1.AbstractReporter {
192
192
  relations: result.relations,
193
193
  muted: result.muted,
194
194
  message: result.message,
195
+ tags: result.tags,
195
196
  };
196
197
  // Internal-only fields are excluded: testops_id, group_params, run_id, author, testops_project_mapping, preparedAttachments
197
198
  return serialized;
@@ -90,6 +90,21 @@ function isAssertionError(error, originalStatus) {
90
90
  }
91
91
  return false;
92
92
  }
93
+ // Cypress-specific failure detection.
94
+ // Cypress uses retry-ability and command-based error syntax that don't contain
95
+ // the word "expect" (unlike Jest/Playwright assertions). Without this branch,
96
+ // genuine UI/command failures fall through to the "timeout → invalid" catch-all
97
+ // below and get misclassified as environment errors.
98
+ //
99
+ // Why this order: the hasNonAssertionPattern check above already returned
100
+ // invalid for cy.request() failures (which contain "network"/"connection"),
101
+ // so reaching this point with a Cypress signature means the error has no
102
+ // infrastructure markers — the test app failed to behave as expected.
103
+ const isCypressRetryTimeout = /timed out retrying after \d+ms/.test(errorMessage);
104
+ const isCypressCommandFailure = /cy\.\w+\(\)\s+(failed|timed out)/.test(errorMessage);
105
+ if (isCypressRetryTimeout || isCypressCommandFailure) {
106
+ return true;
107
+ }
93
108
  // For timeout errors without expect, treat as invalid
94
109
  if (errorMessage.includes('timeout')) {
95
110
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qase-javascript-commons",
3
- "version": "2.5.10",
3
+ "version": "2.6.1",
4
4
  "description": "Qase JS Reporters",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",