🐛 Wait for network idle for responsive asset discovery#512
Merged
Conversation
samarsault
pushed a commit
that referenced
this pull request
Mar 3, 2023
* ⬆️ Bump cypress from 9.7.0 to 10.0.2 Bumps [cypress](https://github.com/cypress-io/cypress) from 9.7.0 to 10.0.2. - [Release notes](https://github.com/cypress-io/cypress/releases) - [Changelog](https://github.com/cypress-io/cypress/blob/develop/.releaserc.base.js) - [Commits](cypress-io/cypress@v9.7.0...v10.0.2) --- updated-dependencies: - dependency-name: cypress dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * ⬆️ Upgrade to Cypress 10.x * ✂️ Remove unneeded comment in config file Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What is this?
Thanks to @cancan101, it was pointed out that the browser may cancel responsive image requests between resizes. While we have a test for this, the test wasn't quite comprehensive enough. Adding a third width to the test reveals that intermediary responsive asset requests between the first and the last are indeed cancelled because the viewport is resized too quickly. The first asset in this test likely only succeeds due to page navigation waiting for the
loadevent.This PR adjusts the test so it accurately fails, then duplicates discovery's idle check before resizing. Unfortunately, this fix has a drawback that causes snapshots to take slightly longer than they used to, by a magnitude of
networkIdleTimeout * (widths.length - 1). So a network idle timeout of100msacross 3 widths would result in the snapshot taking200mslonger than it previously did without this change.Fixes #511