Skip to content

Conversation

@nnyouung
Copy link


Additional details

This PR fixes a bug where grouped commands (e.g. within) inside cy.origin() did not reset the Command Log nesting level, causing subsequent groups to appear nested under the previous one.

Root cause
Cross‑origin logs were mutating or inheriting the primary origin’s log group stack (logGroupIds), so the group level did not properly reset after a grouped command finished.

Fix
Prevent cross‑origin logs from mutating primary logGroupIds (ignore groupStart/groupEnd in primary).
Pass originLogGroupLevel/Id metadata from cy.origin to the spec bridge.
Only fill groupLevel/group when missing, preserving already computed values.

Impact
Grouped commands inside cy.origin() now exit correctly, so subsequent commands appear at the expected nesting level.


Steps to test

- Run:
yarn workspace @packages/driver cypress:run --spec cypress/e2e/e2e/origin/commands/log.cy.ts

- (Optional, visual) Open mode:
yarn workspace @packages/driver cypress:open --e2e
Run log.cy.ts and confirm the second 'within' is at the same level as the first.


How has the user experience changed?

Before
After the first grouped command finishes inside cy.origin(), the Command Log group level does not decrease.
Subsequent commands appear incorrectly nested as if still inside the previous group.

After
Grouped commands inside cy.origin() correctly exit their group.
Subsequent commands display at the correct log level.
(Screenshots/GIF: add before/after if available)

2026-01-27 09 03 18

PR Tasks

@CLAassistant
Copy link

CLAassistant commented Jan 27, 2026

CLA assistant check
All committers have signed the CLA.

@cypress-app-bot
Copy link
Collaborator

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.

Grouped commands nested in cy.origin do not properly decrease their log level when the group is done

3 participants