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

feat: Queries, Detached DOM, and Retry-Ability #24628

Merged
merged 51 commits into from
Nov 14, 2022
Merged

Conversation

BlueWinds
Copy link
Contributor

@BlueWinds BlueWinds commented Nov 9, 2022

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

BlueWinds and others added 30 commits September 1, 2022 15:55
BlueWinds and others added 5 commits October 17, 2022 09:52
* 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]>
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Nov 9, 2022

Thanks for taking the time to open a PR!

@BlueWinds BlueWinds changed the title Issue 7306 feat: Queries, Detached DOM, and Retry-Ability Nov 9, 2022
@cypress
Copy link

cypress bot commented Nov 9, 2022



Test summary

3835 0 414 0Flakiness 0


Run details

Project cypress
Status Passed
Commit 9c2f198
Started Nov 10, 2022 8:59 PM
Ended Nov 10, 2022 9:14 PM
Duration 14:58 💡
OS Linux Debian -
Browser WebKit 16

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

@BlueWinds BlueWinds marked this pull request as ready for review November 10, 2022 20:36
@BlueWinds
Copy link
Contributor Author

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 releases/12.0.0 as-is. Once there, we can coordinate merging develop -> 12.0.0 and fixing any tests in there that are still failing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants