qase-javascript-commons 2.6.1 → 2.6.2

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.6.2
2
+
3
+ ## Bug fixes
4
+
5
+ - Fixed Cypress failure classification in real browser environments. Cypress errors false-positive on the `"http"` non-assertion pattern because (a) browser stack traces contain URLs like `https://localhost/__cypress/runner/...` and (b) all error messages include docs links like `https://on.cypress.io/...`. The classifier now unconditionally trusts Cypress' retry-ability prefix (`Timed out retrying after Nms:`) as a genuine test failure signal, since this prefix is exclusive to DOM-interacting commands and never appears in infrastructure failures (`cy.request()`, `cy.task()`).
6
+
1
7
  # qase-javascript-commons@2.6.1
2
8
 
3
9
  ## Bug fixes
@@ -79,6 +79,11 @@ function isAssertionError(error, originalStatus) {
79
79
  // Check for non-assertion patterns (excluding timeout for special handling above)
80
80
  const nonAssertionPatternsWithoutTimeout = nonAssertionPatterns.filter(pattern => pattern !== 'timeout');
81
81
  const hasNonAssertionPattern = nonAssertionPatternsWithoutTimeout.some(pattern => errorMessage.includes(pattern) || errorStack.includes(pattern));
82
+ // Cypress retry-ability prefix: "Timed out retrying after Nms:" is added by
83
+ // Cypress' retry mechanism exclusively for DOM-interacting commands (cy.get,
84
+ // cy.click, cy.should, cy.wait with aliases). It never appears in infra
85
+ // failures (cy.request, cy.task). This is the most reliable Cypress signal.
86
+ const isCypressRetryTimeout = /timed out retrying after \d+ms/.test(errorMessage);
82
87
  if (hasNonAssertionPattern) {
83
88
  const hasAssertionContext = assertionPatterns.some(pattern => errorMessage.includes(pattern) || errorStack.includes(pattern));
84
89
  const isRunnerFailed = normalizedOriginalStatus === 'failed' || normalizedOriginalStatus === 'timedout' || normalizedOriginalStatus === 'interrupted';
@@ -88,21 +93,19 @@ function isAssertionError(error, originalStatus) {
88
93
  if (isRunnerFailed && hasAssertionContext && !isSyntaxError) {
89
94
  return true;
90
95
  }
96
+ // Cypress override: the retry-ability prefix is a strong signal that the
97
+ // test was actively interacting with the application via a retryable command.
98
+ // Cypress errors false-positive on "http" because (a) browser stack traces
99
+ // contain URLs and (b) all error messages include docs links
100
+ // (https://on.cypress.io/...). The retry prefix itself is never
101
+ // infrastructure, so we trust it unconditionally.
102
+ if (isCypressRetryTimeout && isRunnerFailed) {
103
+ return true;
104
+ }
91
105
  return false;
92
106
  }
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) {
107
+ // Cypress failure without any non-assertion pattern (clean stack trace)
108
+ if (isCypressRetryTimeout) {
106
109
  return true;
107
110
  }
108
111
  // For timeout errors without expect, treat as invalid
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qase-javascript-commons",
3
- "version": "2.6.1",
3
+ "version": "2.6.2",
4
4
  "description": "Qase JS Reporters",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -63,7 +63,7 @@
63
63
  "@types/mime-types": "^2.1.4",
64
64
  "@types/minimatch": "^6.0.0",
65
65
  "@types/uuid": "^9.0.8",
66
- "axios": "^1.13.5",
66
+ "axios": "^1.15.0",
67
67
  "jest": "^29.7.0",
68
68
  "ts-jest": "^29.4.5"
69
69
  }