-
Notifications
You must be signed in to change notification settings - Fork 42
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
Add tests to lock in the waitUntil lifecycle event behaviour #643
Closed
Conversation
This file contains 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
This test ensure that we can navigate to a page and wait for the domcontentloaded lifecycle event. The test ensures that we're not waiting on the async scripts and other network requests to complete before we unblock on the wait.
This test will wait until the html and async scripts have loaded before unblocking the wait. It does not wait for the other network requests to complete.
This test will ensure that when we navigate to a page with goto and waitUntil networkidle, where the page is made up of a main and sub frame, we wait until both frames have completed loading and a networkidle event has been received.
This test will wait for both the main and sub frames to both have loaded ONLY the html. It does not wait for the async scripts and other network requests to complete.
This test will wait for both the main and sub frame to load the html and the async scripts.
This test locks in the timeout behaviour of WaitForNavigation if it is called to late once a navigation has already completed. This is why we suggest that a nav action and WaitForNavigation must be setup in a promise.All.
The next set of tests requires us to wait on a second set of promises. This change refactors the code to allow for that.
This test will perform two navigations. The second navigation occurs after a click action where we use WaitForNavigation to wait until networkIdle event received.
This test will perform two navigations. The second navigation is due to a click action. We also setup WaitForNavigation on domcontentloaded which should succeed in unblocking once the html has loaded. We don't wait for the async scripts and other network requests in either of the navigations.
This test will perform two navigations. The second nav occurs after a click action. At the same time we set WaitForNavigation with load. The html and async scripts must load before we unblock on both nav actions.
This was referenced Nov 8, 2022
inancgumus
added a commit
that referenced
this pull request
Jan 13, 2023
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.
Before we attempt to cleanup the lifecycle event code (#593) we need to lock in the current behaviour so that any refactoring does not affect the behaviour.
The tests are:
waitUntil
onload
andDOMContentLoaded
work as expected when used ingoto
.waitUntil
onload
,DOMContentLoaded
andnetworkidle
work as expected when we navigate to a page with a main and sub frame when used ingoto
.waitUntil
onload
,DOMContentLoaded
andnetworkidle
work as expected when used as an option onWaitForNavigation
.waitUntil
onnetworkidle
timesout if we set it too late after the navigation has completed.Linked issue: #593