Repository navigation
feat(native): waits and UAT observers (phase 5) - #12
Merged
Merged
Conversation
unohee
force-pushed
the
feat/native-snapshot
branch
from
October 25, 2026 03:59
1f9d938 to
95aa236
Compare
- Page.wait_for_function polls in the isolated world (a navigation in the
middle is a fresh poll, not an error); wait_for_url takes Playwright's
globs (* stops at /, ** does not, {a,b}, ? literal), a regex or a
predicate and then waits for the load state; wait_for_load_state reads the
current loader's lifecycle, a document that committed before the page was
set up counting as loaded, as Playwright counts it.
- request / response / requestfailed come from the Network domain the page
already has on; console / pageerror need Runtime.enable, so a page sends it
only once something subscribes to one of them. The UAT recorder does; an
ordinary session never does, and keeps no Runtime.enable on the wire.
Verified: pytest 1755 passed (2 pre-existing macOS sha256sum failures
deselected); tests/native 92; testing/native_wait_observe_smoke_261023_v1.py
10/10: wait_for by load state, by text (waited 2.6 s for it), by URL glob
(waited 1.6 s for a pushState) and a timeout reported as one; the five
observer events with a 503 fetch, console.error / console.warn and a thrown
error; Runtime.enable absent until a console observer exists, then sent
once. The phase 1-2, 3 and 4 real-browser runs still pass.
unohee
force-pushed
the
feat/native-wait-observe
branch
from
October 25, 2026 04:01
d5c7a05 to
e11eb95
Compare
unohee
marked this pull request as ready for review
October 25, 2026 04:02
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.
Stacked on #11. This is phase 5 of the plan.
What
Page.wait_for_functionpolls in the isolated world. A navigation during the wait just starts a new poll; it is not an error.wait_for_urlaccepts a Playwright glob, a regex or a predicate, then waits for the load state. Glob rules:*stops at/,**does not,{a,b}is an alternation,?matches a literal?.wait_for_load_statereads the lifecycle of the current document. A document that committed before the page was set up counts as loaded, as it does in Playwright.request,responseandrequestfailedcome from the Network domain, which every page already has enabled.consoleandpageerrorneedRuntime.enable. A page sends it only once something subscribes to one of those two events.Runtime.enablenever goes out for it.Verified
pytest: 1755 passed. The two pre-existing macOSsha256sumfailures were deselected.tests/native: 92 tests.testing/native_wait_observe_smoke_261023_v1.py: 10/10.wait_forby load statewait_forby textwait_forby URL glob on apushStatewait_forthat never matchesconsole.error,console.warn, a thrown error)Runtime.enablebefore any console observerRuntime.enableafter a console observer subscribesThe real-browser runs for phases 1–2, 3 and 4 still pass.