-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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: empty state urls in navigation #20948
Conversation
Thanks for taking the time to open a PR!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 Thank you for the contribution!
packages/driver/src/cy/navigation.ts
Outdated
@@ -25,6 +26,11 @@ export const historyNavigationTriggeredHashChange = (state): boolean => { | |||
} | |||
|
|||
const urls = state('urls') | |||
|
|||
if (_.isEmpty(urls)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's explicitly check for a urlPosition value here too before continuing on. Your second spec asserts that it doesn't throw without a value, but the logic that follows isn't very meaningful without one.
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
undefined (reading 'undefined')
on cypress_runner.js #19749User facing changelog
n/a
Additional details
This issue occurs during url state changes and Cypress attempts to test the current url, but the state is empty.
How has the user experience changed?
Cypress stops randomly throwing this error and failing tests:
TypeError: Cannot read properties of undefined (reading 'undefined')
PR Tasks
cypress-documentation
?type definitions
?cypress.schema.json
?