fix: ensure that code frames within cy.origin point to the right line of the code#32597
Merged
Conversation
ryanthemanuel
commented
Sep 29, 2025
ryanthemanuel
commented
Sep 29, 2025
ryanthemanuel
commented
Sep 29, 2025
cypress
|
||||||||||||||||||||||||||||||||||||||||
| Project |
cypress
|
| Branch Review |
ryanm/fix/origin-code-frames
|
| Run status |
|
| Run duration | 19m 53s |
| Commit |
|
| Committer | Ryan Manuel |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
11
|
|
|
1102
|
|
|
0
|
|
|
26666
|
| View all changes introduced in this branch ↗︎ | |
UI Coverage
44.73%
|
|
|---|---|
|
|
189
|
|
|
157
|
Accessibility
97.71%
|
|
|---|---|
|
|
4 critical
8 serious
2 moderate
2 minor
|
|
|
110
|
cacieprins
approved these changes
Sep 30, 2025
AtofStryker
reviewed
Sep 30, 2025
Collaborator
AtofStryker
left a comment
There was a problem hiding this comment.
just for changelog consistency but we can update this on release day
| **Bugfixes:** | ||
|
|
||
| - Fixed a regression introduced in [`15.0.0`](https://docs.cypress.io/guides/references/changelog#15-0-0) where `dbus` connection error messages appear in docker containers when launching Cypress. Fixes [#32290](https://github.com/cypress-io/cypress/issues/32290). | ||
| - Fixed code frames in `cy.origin` so that failed commands will show the correct line/column within the corresponding spec file. Addressed in [#32597](https://github.com/cypress-io/cypress/pull/32597). |
Collaborator
There was a problem hiding this comment.
Suggested change
| - Fixed code frames in `cy.origin` so that failed commands will show the correct line/column within the corresponding spec file. Addressed in [#32597](https://github.com/cypress-io/cypress/pull/32597). | |
| - Fixed code frames in [`cy.origin()`](http://on.cypress.io/api/origin) so that failed commands will show the correct line/column within the corresponding spec file. Addressed in [#32597](https://github.com/cypress-io/cypress/pull/32597). |
cacieprins
pushed a commit
that referenced
this pull request
Oct 1, 2025
… of the code (#32597) * fix: ensure that code frames within cy.origin point to the right line of the code * additional tests * additional tests * changelog * Apply suggestions from code review * Update system-tests/projects/e2e/cypress/e2e/cy_origin_error.cy.ts * fix tests * fix tests * clean up
Contributor
|
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Additional details
This PR fixes code frames within
cy.origin. It does this by adding a line offset to the user invocation stack for commands withincy.originbased on the stack trace of theevaled statement that is executed withincy.origin.Steps to test
How has the user experience changed?
PR Tasks
cypress-documentation?type definitions?Note
Fixes cy.origin error code frames/stack traces to reference the correct spec line/column by merging cross-origin invocation stacks and propagating them through error handling.
crossOriginUserInvocationStackfrompackages/driver/src/cross-origin/origin_fn.tsand attach toerrinpackages/driver/src/cy/commands/origin/index.ts.originUserInvocationStackin state sent to secondary origin; merge into local stacks when capturing command stacks inpackages/driver/src/cypress/cy.tsandpackages/driver/src/cypress/chainer.ts.normalizedUserInvocationStackand addmergeCrossOriginUserInvocationStackto adjust top frame line/column across origins (packages/driver/src/cypress/stack_utils.ts).skipTitleValidation.cy.originnow show correct spec line/column.Written by Cursor Bugbot for commit 0c39017. This will update automatically on new commits. Configure here.