Revert changes to query*s and add deprecation warning
See original GitHub issueAs noted in #108, we accidentally broke the query*
queries. We should restore those to the original behavior and add a deprecation warning. Let’s try to make it subtle enough to not be really annoying, but present enough to be noticed 😃
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:14 (9 by maintainers)
Top Results From Across the Web
How to fix a Hibernate query with deprecation warnings?
As the message says, use named parameters instead. List users = sessionFactory.getCurrentSession() .createQuery( "from User where username = :username" ) .
Read more >Adding deprecation messages - GitLab Docs
Adding deprecation messages. We store a list of deprecations associated with it in the list method of Gitlab::Deprecations class If a configuration has...
Read more >T218994 Deprecation warning on elasticsearch 6
Description · T209859 Setting a negative [weight] in Function Score Query is deprecated and will throw an error in the next major version...
Read more >GraphQL API deprecation process - Totara Help
If you rename schema items this will be a breaking change - consider it the same as adding one item and removing another....
Read more >Deprecations, additions, and compatibility - Cypher Manual
all of the features that have been removed, deprecated, added, or extended in ... Changes to the visibility of databases hosted on offline...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I know why this is happening now. I changed
query*
to useverifyUpcomingAssertions
which will put an implicitshould('exist')
after the command. That works if you follow the command with an assertion - the explicit assertion changes the implicit one. If you disconnect the chain with a.then
and a.wrap
, the implicit assertion is in place and it doesn’t get to the.wrap
. That’s true for built-in Cypress commands as well.The reason the
wrap
worked before is becausequery
used to returnnull
and not fail like other commands that return DOM. This functionality might have been intentional sincefind*
commands didn’t always retry properly. (I think that happened in 5.0).I’m very sorry for the inconvenience. I’m glad the Cypress Testing Library
find*
commands work more like native Cypress commands. It makes it more natural to use in the Cypress context.I’ll leave this issue open a bit more. Perhaps it is still safer to revert the
query*
line of queries. There’s a higher chance the upgrade breaks people that haven’t updated yet. Your code should be fine. The code can warn about the deprecation ofquery*
and suggest an upgrade pathThat must be what I was missing. It seems to be working with eventually not existing, but failing on does not exist now. I can reproduce again! Thank you!
There is a risk that reverting the change will break those relying on how 5.2 works now… 😦