Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Aliases properly retry commands from inside custom commands #23663

Merged
merged 1 commit into from
Sep 1, 2022

Conversation

BlueWinds
Copy link
Contributor

@BlueWinds BlueWinds commented Sep 1, 2022

User facing changelog

Fix: Mixing custom commands and aliases now works again. Fixes regression introduced between 10.4.0 and 10.5.0.

Additional details

When a custom command invoked cypress commands, these 'internal' commands' return values are properly used as the subject for future commands, via the 'subjectLinks' internal Cypress state.

However, as of 10.5.0, aliases were not respecting these links, meaning they would end up with 'undefined' for a subject instead of the proper one (which would come from replaying the 'internal' commands).

See the test added by this PR for a more concrete example.

Steps to test

Added automated test demonstrating the issue. Also see the repro in #23652 for external validation.

How has the user experience changed?

PR Tasks

  • Have tests been added/updated?
  • Has the original issue (or this PR, if no issue exists) been tagged with a release in ZenHub? (user-facing changes only)
  • [n/a] Has a PR for user-facing changes been opened in cypress-documentation?
  • [n/a] Have API changes been updated in the type definitions?

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Sep 1, 2022

Thanks for taking the time to open a PR!

@cypress
Copy link

cypress bot commented Sep 1, 2022



Test summary

4718 0 381 0Flakiness 1


Run details

Project cypress
Status Passed
Commit 5a44502
Started Sep 1, 2022 9:17 PM
Ended Sep 1, 2022 9:31 PM
Duration 14:49 💡
OS Linux Debian - 11.3
Browser Multiple

View run in Cypress Dashboard ➡️


Flakiness

cypress/e2e/e2e/origin/commands/spies_stubs_clocks.cy.ts Flakiness
1 cy.origin spies, stubs, and clock > spy()

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

Copy link
Contributor

@rachelruderman rachelruderman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excelente! Tested locally with the OG issue and worked like a charm 🌟

@BlueWinds BlueWinds merged commit 8e4ebef into develop Sep 1, 2022
@BlueWinds BlueWinds deleted the issue-23652 branch September 1, 2022 21:48
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.

alias returns undefined when there is a customized get command for the alias and I visit the page again
3 participants