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

Fix test flakiness in Firefox #438

Merged
merged 1 commit into from
Feb 29, 2024
Merged

Fix test flakiness in Firefox #438

merged 1 commit into from
Feb 29, 2024

Conversation

philipwalton
Copy link
Member

@philipwalton philipwalton commented Feb 29, 2024

Fixes #436.

Geckodriver has a bug where, if the webdriver PageLoadStrategy option is set to "none" then calls to browser.url() can resolve before the browser has actually navigated to the page.

This library needs to set the PageLoadStrategy to "none" for many tests, so the only good way to fix this is to wrap the browser.url() function (the navigateTo() function in this PR) and manually verify that the correct URL is loaded before resolving. As a convenience this wrapped function also exposes an option to conditionally wait for a given documentreadyState value.

In addition, since Firefox added support for LCP but does NOT support Element Timing, this PR adds a workaround for LCP tests to wait for load + rAF as a proxy for ensuring all images are loaded and painted.

Copy link
Member

@tunetheweb tunetheweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice investigation and solutions!

@tunetheweb tunetheweb merged commit 8058a00 into main Feb 29, 2024
4 checks passed
@philipwalton philipwalton deleted the firefox-flakiness branch February 29, 2024 15:15
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.

Firefox LCP tests failing
2 participants