-
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
feat: Queries, Detached DOM, and Retry-Ability #24628
Conversation
…cypress into issue-7306-addSelector-redux
* First stab at removing old .get() implementation * Fix TS and a couple of tests * Fix tests and TS * Fix case-sensitivity for .contains() * Stop TS complaining * Rework cy-contains jquery expression * Add comments, make ts happy * Fix one test, review feedback * Review updates * Fix additional tests * Fix accidental deletion of vital code * One more try at getting logs right * Fix race condition in cross-origin .contains * Add commented out test to ensure .within() works properly with selectors * Fix for sessions + query subject chaining * Fix mixing .within() shadow DOM and .contains() in same chainer * One more attempt at .within + .contains * Fix rebase commits * Update many commands to be queries; improve log message around invalid subjects * Update connectors, location, focused and window commands to queries * Return noop to a command and not a query (to avoid implicit assertions) * More test fixes * Fix test failures * Fix for weird-ass frontend-component test * Error message improvements * Fix for broken system test * Update withinSubject to use subject chain * Test clarifications * Unbreak cypress-testing-library via withinState backwards compatibility * Typo in last commit * Improvement for assertion following failed traversal
* First stab at removing old .get() implementation * Fix TS and a couple of tests * Fix tests and TS * Fix case-sensitivity for .contains() * Stop TS complaining * Rework cy-contains jquery expression * Add comments, make ts happy * Fix one test, review feedback * Review updates * Fix additional tests * Fix accidental deletion of vital code * One more try at getting logs right * Fix race condition in cross-origin .contains * Add commented out test to ensure .within() works properly with selectors * Fix for sessions + query subject chaining * Fix mixing .within() shadow DOM and .contains() in same chainer * One more attempt at .within + .contains * Fix rebase commits * Update many commands to be queries; improve log message around invalid subjects * Update connectors, location, focused and window commands to queries * Return noop to a command and not a query (to avoid implicit assertions) * More test fixes * Fix test failures * Fix for weird-ass frontend-component test * Error message improvements * Fix for broken system test * Update withinSubject to use subject chain * Test clarifications * Unbreak cypress-testing-library via withinState backwards compatibility * Typo in last commit * Improvement for assertion following failed traversal * WIP adding query support to * More work on actionability + detached dom * Fix TS, rename _addQuery to addQuery * Another try to fix types * Fix lint * Fix for bad merge * Fixes for a couple more tests * Increase timeout 50ms -> 100ms on certain tests failing in CI * Switch to new branch of cypress-testing-library * Update lockfile * Fix yarn.lock with latest version of forked testing-library * More test fixes * Fix TS again * Increase test assertion timeout so it passes on slow browsers (webkit) * Apply suggestions from code review Co-authored-by: Emily Rohrbough <[email protected]> Co-authored-by: Zach Bloomquist <[email protected]> * More review changes * Fix selectFile tests based on updated error message * Improve types and type comments for Commands.add * Undo change to Commands.add types * Update yarn lockfiles again * Remove overwriteQuery from Cy12; .focused() now respects passed in timeout * Update cli/types/cypress.d.ts Co-authored-by: Chris Breiding <[email protected]> * Restore .uncheck() tests Co-authored-by: Emily Rohrbough <[email protected]> Co-authored-by: Zach Bloomquist <[email protected]> Co-authored-by: Chris Breiding <[email protected]>
Thanks for taking the time to open a PR!
|
Test summaryRun details
View run in Cypress Dashboard ➡️ 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 |
There are currently some failing tests, but I believe they're at least mostly unrelated to the changes here. I'd like to merge this into |
User facing changelog
Added the concept of "queries" to Cypress, breaking up existing commands into the categories of "Queries", "Assertions", "Actions" and "Commands". This change fixes the majority of Detached DOM errors, and updates the error messages when they do occur pointing out the correct way to solve them.
This is a breaking change. Please see the associated docs PR for more details.
Additional details
Steps to test
How has the user experience changed?
See the following PRs for screenshots and updated error messages.
See the docs PR for a better idea of the scope of user facing changes:
PR Tasks
cypress-documentation
? Queries, Detached DOM, and Retry-Ability cypress-documentation#4835type definitions
?