test: cover waitforhelper network multiplier and navigation paths - #2515
Open
ZayanKhan-12 wants to merge 1 commit into
Open
test: cover waitforhelper network multiplier and navigation paths#2515ZayanKhan-12 wants to merge 1 commit into
ZayanKhan-12 wants to merge 1 commit into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
ZayanKhan-12
force-pushed
the
chore/tests-waitforhelper
branch
from
August 8, 2026 21:46
c80548a to
f4b792c
Compare
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.
Why
tests/WaitForHelper.test.tscurrently only covers dialog handling. The exported pure functiongetNetworkMultiplierFromString(src/WaitForHelper.ts) had no coverage at all, and the navigation/timeout paths ofwaitForEventsAfterActionwere untested. This PR expands the test file to lock in the current behavior of those paths. Nosrc/changes.Coverage added
getNetworkMultiplierFromString: exact multipliers for each predefined condition (Fast 4G→ 1,Slow 4G→ 2.5,Fast 3G→ 5,Slow 3G→ 10), fallback to 1 for unknown strings and fornull.navigatedToUrlset to the destination.#stableDomTimeout) with nonavigatedToUrl.navigatedToUrlis reported.Observation (current behavior, asserted as-is)
When a started navigation times out and remains pending, the subsequent stable-DOM wait cannot settle (in-page evaluations do not complete while the navigation is pending), so it consumes the full
#stableDomTimeout. With{timeout: 500}the call still takes ~3.5s total (500ms navigation timeout + 3s stable-DOM timeout). The test documents this rather than changing it.Note: this is independent of the open PR #2504 (popup tracking in
WaitForHelper); it only touches network-multiplier and navigation/timeout behavior, so the two do not conflict.Testing
node scripts/test.js tests/WaitForHelper.test.ts— 11/11 pass (run 3x to check for flakes)npm run test:no-build— full suite greennpm run check-format— clean🤖 Generated with Claude Code