Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After working on the feature tests in #1119, it's clear that React Testing Library is much better than Cypress Testing Library at waiting for React to finish rendering. That's why we have a lot of workarounds in the E2E specs, waiting for unrelated things to appear, and why we get a lot of retry attempts in the CI.
In this PR, I'm introducing a query called
cy.waitForStableDom()
found here: https://github.com/narinluangrath/cypress-wait-for-stable-dom/, which seems to perfectly solve all our problems. It tells Cypress to wait until there are no more mutations in the DOM over a given period of time. By calling it after every user action (click
,type
, etc.), all the tests pass on their first attempts.The polling interval is currently set to 300ms, a bit more than the slicing slider, just to be safe for the screenshots. In #1119, I'm introducing a way to detect when a slice selection is actually applied to the visualization, so once it is merged, I will try to refactor to reduce the delay.