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: add safety check for command.clone when cmd does not have args #20998

Merged
merged 1 commit into from
Apr 8, 2022

Conversation

emilyrohrbough
Copy link
Member

@emilyrohrbough emilyrohrbough commented Apr 8, 2022

While pulling in the logGroup changes into within in the 10.x branch, I noticed two consistent command failures with the following error:

Screen Shot 2022-04-08 at 9 04 53 AM

The test flow could be summarized like:

cy.get('modal').as('modalAlias').within(() => {}) // within using log group

// do something 

cy.get('@modalAlias') // command replay is triggered which includes replaying the end-logGroup command

When a command is replayed, it's cloned and injected into the command queue.
When the command is cloned, it pull sanitize the commands args list to pull forward an create a new command. Generally commands have args, but because the injected end-logGroup command did not have args passed, it was undefined and caused this error.

This check just ensures commands lacking args can successfully be cloned.

User facing changelog

n/a

PR Tasks

  • Have tests been added/updated?
  • [n/a] 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?
  • [n/a] Have new configuration options been added to the cypress.schema.json?

@emilyrohrbough emilyrohrbough requested a review from a team as a code owner April 8, 2022 14:17
@emilyrohrbough emilyrohrbough requested review from jennifer-shehane and removed request for a team April 8, 2022 14:17
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Apr 8, 2022

Thanks for taking the time to open a PR!

@emilyrohrbough emilyrohrbough requested review from mjhenkes and mschile and removed request for jennifer-shehane April 8, 2022 14:17
@cypress
Copy link

cypress bot commented Apr 8, 2022



Test summary

19383 0 218 0Flakiness 1


Run details

Project cypress
Status Passed
Commit dc41e6b
Started Apr 8, 2022 2:12 PM
Ended Apr 8, 2022 2:24 PM
Duration 11:40 💡
OS Linux Debian - 10.10
Browser Multiple

View run in Cypress Dashboard ➡️


Flakiness

cypress/integration/cypress/proxy-logging_spec.ts Flakiness
1 Proxy Logging > request logging > xhr log has response body/status code when xhr response is logged second

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

@emilyrohrbough emilyrohrbough merged commit d5c033f into develop Apr 8, 2022
@emilyrohrbough emilyrohrbough deleted the command-clone-saftey branch April 8, 2022 16:45
@emilyrohrbough emilyrohrbough added the type: chore Work is required w/ no deliverable to end user label Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: chore Work is required w/ no deliverable to end user
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants