Improved page loading in testing#16
Merged
Merged
Conversation
…necessary tests changes
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.
Improved page loading in testing
Summary
Updated the test suite to use
domcontentloadedinstead ofnetworkidle, when applicable, for better control over when tests execute. This ensures that tests run when the DOM is fully loaded, improving reliability and performance. Also added test fixtures to avoid tests being network dependent whenever possible.Changes
Updated wait strategy in multiple tests:
test/E2ETesting/gallery.spec.ts, updated thepage.gotocall to use{ waitUntil: 'domcontentloaded' };test/E2ETesting/imageLoading.spec.ts, updated thepage.gotocall to use{ waitUntil: 'domcontentloaded' };test/E2ETesting/languageSelect.spec.ts, updated thepage.gotocall to use{ waitUntil: 'domcontentloaded' };test/E2ETesting/nav.spec.ts, updated thepage.gotocall to use{ waitUntil: 'domcontentloaded' };test/E2ETesting/pageLoading.spec.ts, updated thepage.gotocall to use{ waitUntil: 'domcontentloaded' };test/E2ETesting/themeToggle.spec.ts, updated thepage.gotocall to use{ waitUntil: 'domcontentloaded' };test/E2ETesting/umami.spec.ts, updated thepage.gotocalls to use{ waitUntil: 'load' };Added a new fixture file (
test/E2ETesting/fixtures.ts) to block all image requests from external domains;Updated various test files to use this new fixture, ensuring that network requests are controlled during tests;
Notes
The new fixture provides better isolation for tests, reducing flakiness due to external CDN requests.
The
Lightbox navigates to next imagetest ingallery.spec.tsstill is still CDN dependent, because the test compares the current image to the next image to check if it actually navigated to the next image. Without it actually loading the images, it would be comparing null to null, so, until I can mock this, it will stay network dependent.