Commit 81da26b
authored
fix(test): prevent infinite Cypress hang in StubWindowNAssert (#42201)
## Description
`DeployModeHelper.StubWindowNAssert()` stubs `window.open` with a
`callsFake` that sets `window.location.href = url`, navigating the
current Cypress tab to an external docs URL (docs.appsmith.com). If that
external site is slow or unreachable from CI, Cypress blocks
indefinitely — there is no built-in timeout for cross-origin page loads.
Observed in CE run
[33826464528](https://github.com/appsmithorg/appsmith/actions/runs/33826464528),
shard 27: `GoogleSheets_spec.ts` test 2 ("Bug #25004 - Verify Google
Sheets documentation opens") hung for **3h49m** before the 6h GH runner
default timeout cancelled the job. The same spec completed in ~1min on
Sep 1, 2, 3, and 7 — the hang was triggered by external site
unreachability, not a code change.
### Root cause
The stub redirects the current page to docs.appsmith.com via
`window.location.href = url`. Cypress waits for `document.readyState ===
"complete"` before executing the next queued command. If the external
page never finishes loading, Cypress hangs forever — no timeout applies
to cross-origin page loads.
### Fix
Stub `window.open` without any navigation. Assert the stub was called
with the expected URL string (via `stub.firstCall.args[0]`) instead of
navigating to the external page and checking `cy.url()`. This:
- Tests the same intent: "clicking Learn More calls `window.open` with
the correct docs URL"
- Eliminates the external dependency entirely
- Is deterministic — stub assertions are synchronous
### Impact
All callers of `StubWindowNAssert` benefit:
- `GoogleSheets_spec.ts` (the spec that hung)
- `DSDocs_Spec.ts` (9 callers)
- `Snowflake_Basic_Spec.ts`
- `Table.ts` → `AssertURLColumnNavigation`
- EE: `SCIMConfigResourcesViaUI_spec.ts`
No caller depends on the navigation side-effect — each either ends the
test afterward or continues with actions on the (unchanged) current
page.
Fixes https://linear.app/appsmith/issue/APP-15927
## Automation
/ok-to-test tags="@tag.Datasource"
### 🔍 Cypress test results
<!-- This section is auto-populated by Cypress. Do not edit -->
## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No
<!-- This is an auto-generated comment: Cypress test results -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/34156440825>
> Commit: f3cb9b8
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=34156440825&attempt=2"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Datasource`
> Spec:
> <hr>Tue, 08 Sep 2026 04:56:22 UTC
<!-- end of auto-generated comment: Cypress test results -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **Bug Fixes**
- Improved validation for links that open in a new window.
- Updated documentation link handling to use the current SMTP
documentation destination.
- Prevented link checks from navigating away from the current page.
- **Tests**
- Streamlined datasource documentation checks for more reliable test
execution.
- Improved compatibility with existing link-validation scenarios.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent 3d74c59 commit 81da26b
3 files changed
Lines changed: 22 additions & 18 deletions
File tree
- app/client/cypress
- e2e/Regression/ServerSide/QueryPane
- support/Pages
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| |||
Lines changed: 1 addition & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | 8 | | |
13 | 9 | | |
14 | 10 | | |
| |||
60 | 56 | | |
61 | 57 | | |
62 | 58 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
| 59 | + | |
67 | 60 | | |
68 | 61 | | |
69 | 62 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
116 | 118 | | |
117 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
118 | 133 | | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | 134 | | |
123 | | - | |
124 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
125 | 138 | | |
126 | | - | |
127 | | - | |
128 | 139 | | |
129 | 140 | | |
130 | 141 | | |
| |||
0 commit comments