fix(web): observe responses before the first navigation
Merged
BO
11d ago+76+76+01234567890123456789-8-8-0123456789
What and why
browser.waitForResponsecan observe the response from the firstbrowser.gotoorapp.open. Previously it rejected withAPP_NOT_OPENbefore navigation could begin.- The wait and navigation share one pending active page and resume in call order. Existing media emulation, recording, cleanup and active-tab scope are retained.
- Includes Chromium, lifecycle and built-CLI regressions, documentation, the generated consumer skill and a web patch changeset.
Addresses the pre-navigation response-wait gap in #1020.
const [response] = await Promise.all([
browser.waitForResponse('**/network'),
browser.goto('/network'),
]);
expect(response.status).toBe(200);
flowchart LR
W["waitForResponse"] --> P["Shared first-page opening"]
G["goto or app.open"] --> P
P --> L["Register response listener"]
L --> N["Navigate"]
N --> R["Resolve response wait"]
Verified
Ran it locally: yes
- Tested head
4bb44bfaagainst basec82a03a2, including the media-emulation changes from #1030, on Linux Node 22.23.3. Fromapps/testbed, used the built CLI with video off so recording setup cannot open the page and hide the defect:
node node_modules/e2e/dist/cli/bin.js run tests/network.e2e.ts \
--grep "observes the first navigation response" --video off --reporter list,markdown
| Current base | This branch |
|---|---|
APP_NOT_OPEN: no app page is open; call app.open() or browser.goto() first | observes the first navigation response passes |
| Focused regressions: 26 pass, 2 fail | Focused regressions: 28 pass |
pnpm checkpasses. The web suite passes 559 tests with one skip; built-CLI testbed passes 79 with one skip; web benchmark passes 91/91. The initial web run lacked the required Chromium binary; these results are from the rerun after installing it.- Follow-up
e2ba3700addresses the three documentation nits without changing executable code.pnpm checkwas rerun successfully; the runtime results above remain from4bb44bfa. - Fresh-context review found no actionable issues. A delayed-media probe confirms one page, one emulation and listener continuation before navigation. The full core suite was not rerun for this rebase.
- The earlier six-pair benchmark comparison was inconclusive. This change makes no performance claim. The earlier rendered-guide review is retained; no guide text changed during the rebase. Screenshot upload requires upstream write access, so media remains local.
Checklist
- Changeset added (
pnpm changeset) for any change to a published package, or the change is testbed, docs, or CI only. Web patch entry added. - Breaking change: title carries
!, the changeset body names what breaks and what replaces it, and the deprecation warning landed a window earlier (stability policy in CONTRIBUTING.md). N/A: no breaking change. - Docs updated in the same PR: the
docs/**/*.mdxpage for the behavior, andskills/e2e/if the skill describes it. - Contract change: emitted
.d.tsreviewed,tests/types/sdk-types.tsupdated; wire change edits the schema and both fixtures. N/A: public signatures and wire formats are unchanged. - Engine contract change (
e2e/engine): changesets fore2e,@e2e-dev/web, and@e2e-dev/mobile. N/A: no engine contract change.