Skip to content

Sdk 6463 nx tsconfig and a11y after each fixes#1146

Merged
hamza-browserstack merged 10 commits into
drop_sdk_6463from
sdk-6463-nx-tsconfig-and-a11y-afterEach-fixes
Jul 6, 2026
Merged

Sdk 6463 nx tsconfig and a11y after each fixes#1146
hamza-browserstack merged 10 commits into
drop_sdk_6463from
sdk-6463-nx-tsconfig-and-a11y-afterEach-fixes

Conversation

@hamza-browserstack

Copy link
Copy Markdown
Contributor

No description provided.

Bhargavi-BS and others added 10 commits June 19, 2026 14:50
When the cypress config is TypeScript and lives in an NX/monorepo, the extends temp tsconfig inherited base options (noEmit / emitDeclarationOnly / composite / noEmitOnError) that suppress or redirect the compiled JS, and any tsc type-error short-circuited the '&&'-chained tsc-alias so path aliases were left un-rewritten. The compiled config then could not be found/required, the error was silently swallowed, and getNumberOfSpecFiles fell back to a default glob that found 0 specs -> setParallels collapsed parallels to 1.

Force emit-friendly overrides in the extends temp tsconfig and run tsc-alias unconditionally (& / ; instead of &&). Adds regression tests covering the emit-override and unconditional-alias behavior.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…K-6463)

A hung accessibility scan made the 30s cy.wrap() time out and fail the afterEach hook, which makes Cypress skip ALL remaining tests in the spec (they surface as 'skipped' instead of running). Add .catch handlers to both cy.wrap(..., {timeout:30000}) chains (performScan and saveTestResults) so a timeout is logged instead of cascading into skipped tests. Adds a regression test that loads the real plugin afterEach and asserts tolerance.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ways-settle (SDK-6463)

The earlier afterEach used .catch() on Cypress chains (cy.wrap(...).then(...).catch(...)). Cypress Chainable has no .catch (commands are not promises), so it threw 'cy.wrap(...).then(...).catch is not a function' synchronously in the hook, failing it and aborting the rest of the spec — the customer's exact symptom.

Rework: performScan/saveTestResults now ALWAYS settle (internal timeout tunable via ACCESSIBILITY_SCAN_TIMEOUT, default 25s) and guard cross-origin window access, so cy.wrap's 30s timeout never fires and the hook never throws. Verified with REAL Cypress (headed): the old code reproduces 'skipping all of the remaining tests'; the reworked code runs all tests and completes the scan path (Payload to send / Saved accessibility test results logged).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…nsion (SDK-6463)

glob.sync (glob@7->minimatch@3, and even glob@10->minimatch@9) throws 'expand is not a function' / 'brace_expansion_1.default is not a function' when a project force-resolves brace-expansion to an incompatible major (e.g. 5.x) via yarn resolutions / npm overrides. That crash aborted getNumberOfSpecFiles and produced builds with 0 executed tests (or crashed the run). A secondary bug in deleteBaseUrlFromError (err.replace on a non-string) then masked the real error.

- Wrap glob.sync in safeGlobSync: log once and return [] on failure so spec discovery and the run proceed (specs are resolved on BrowserStack regardless of the local count).
- Backstop try/catch in getNumberOfSpecFiles so it never throws.
- Guard deleteBaseUrlFromError against non-string errors.

Verified against a real glob@7 + brace-expansion@5 crash. Adds regression tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ion-resilience

fix(SDK-6463): survive glob/minimatch crash from incompatible brace-expansion (0-test builds)
… repeated scan timeouts (SDK-6463)

The always-settle rework stops scan/save promises from hanging, but the a11y afterEach can still FAIL from its own Cypress commands — e.g. cy.window() on a cross-origin page (SSO redirect to login.microsoftonline.com) or cy.task('get_test_run_uuid') when the TO node plugin isn't registered. Cypress chains have no .catch, so the correct 'catch' is the per-test fail listener: cy.on('fail', () => false) registered at the top of the hook suppresses any failure raised by the hook's commands, so the user's test is never failed and the spec is never aborted.

Also adds a circuit breaker: each hung scan/save costs up to ACCESSIBILITY_SCAN_TIMEOUT (default 25s) per test; after 3 consecutive timeouts (configurable via ACCESSIBILITY_SCAN_CIRCUIT_LIMIT) the plugin stops attempting accessibility work for the rest of the spec instead of stalling every remaining test and wrapped command.

Verified with REAL Cypress 13.15.0 (headed):
- unregistered-task scenario: without guard -> hook fails, 'skipping all of the remaining tests' (0 passing); with guard -> all tests pass
- hung-scanner scenario: all tests pass, no abort
- circuit breaker: deterministic server-side count shows A11Y_SCAN stops after the circuit opens (2 hits across 4 tests)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…il-guard

fix(SDK-6463): catch a11y afterEach failures (cy.on fail guard) + circuit-break repeated scan timeouts
Addresses review feedback on #1131 — comments now describe the behavior without referencing the internal ticket.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@hamza-browserstack
hamza-browserstack requested a review from a team as a code owner July 6, 2026 19:04
@hamza-browserstack
hamza-browserstack requested review from 07souravkunda and osho-20 and removed request for a team July 6, 2026 19:04
@hamza-browserstack
hamza-browserstack merged commit f22ffcd into drop_sdk_6463 Jul 6, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants