-
Notifications
You must be signed in to change notification settings - Fork 153
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
chore: add deprecation warning to query* #125
chore: add deprecation warning to query* #125
Conversation
This PR navigates breaking changes over minor versions with time in-between. The original author fixed it so this PR doesn't matter to him anymore. We're not sure which breaking API is what people are using... So question on this PR. Should I:
Personally, I like 2. |
I'm in favor of option 2 as well. And, as a side-note, if there are any other breaking changes you'd like to make, then feel free to open them on the |
Updated with option 2. |
It seems like it might be a timing thing. It passes locally. I'll update for timing differences. |
Hmmm... Still failing on CI 😬 |
It was passing locally no matter what I did. Upgrading to 4.1.0 allowed me to duplicate CI failures. Very strange. |
It looks like an upgrade to Chai v4: chaijs/chai#1007 (comment) |
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.
This is great. I think we can meet this and then drop query for the major version tomorrow. Thank you for all your work!
🎉 This PR is included in version 5.3.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Fixes #117
Checklist:
This PR is overdue. I had the fix for a while, but sat on it too long. If you read up on #117, you'll see the person who filed the bug no longer has the issue. This PR does revert the
query*
functionality to what it was previously. The functionality difference is subtle, but I'll explain it here:After #108,
query*
was subtly changed to have the same functionality asfind*
queries, but with no retries. This changed the error messages (they were more helpful), but also changed the way the command worked which would break in this circumstance:Before the
cy.queryByText('Never Exists')
would returnnull
and the test would pass. After, thecy.queryByText('Never Exists')
ran through Cypress's internal verification of upcoming assertions. Implicitly a.should('exist')
was added to all commands that didn't explicitly have an assertion, making the command run like the following:With this subtle change, immediate non-existence no longer works with
query*
because it is first expected to exist and will fail before the.then
is called.There is a deprecation warning that states
query*
should not be used and to usefind*
instead. The next major release will removequery*
. Within the context of Cypress, only thefind*
line of queries make sense. All Cypress commands retry since all Cypress commands are asynchronous andquery*
was only useful becausefind*
didn't handle eventual non-existence well.