test: real Puppeteer/Playwright connect smoke test (xfail until the answerer is complete) - #3
Conversation
… now) handshake.test.ts drives a synthetic client, so it stays green while a stock client still cannot open a page. This drives the real ones (puppeteer-core, playwright-core): connect -> newPage -> goto. It is the acceptance test for the handshake answerer (issue 1clawAI#2). Marked it.fails on purpose. As of the answerer landing, a stock client gets past Browser.getVersion and then blocks: with the gate enforced it is refused on the next method it sends (Target.getBrowserContexts for Puppeteer, Browser.setDownloadBehavior for Playwright); even with every method allowed, newPage() never resolves, because the proxy does not synthesise the target-lifecycle events the client waits for to build its Page. When the answerer presents a coherent target lifecycle for a client's own pages, the body passes, it.fails turns red, and that is the signal to drop the .fails. The framework clients are not added as dependencies — a smoke test should not pull Playwright's install into everyone's CI. The test skips unless they are present; run it with `pnpm add -D -w puppeteer-core playwright-core` then `pnpm test framework-connect`. Verified both paths locally: skips clean without them, passes as xfail with them. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WqPU5z6K3maS9J6LrcsEic
The test arrived as an xfail tripwire for a gap that was real, and it was right on every detail. It has fired: stock puppeteer-core and playwright-core now connect, open a page and navigate through the gate, so the `.fails` is gone and these are ordinary tests that run in CI. Co-authored-by: redbotster <redbotster@users.noreply.github.com> Claude-Session: https://claude.ai/code/session_019d5ks2kCa4eXD1ftdkECPu
|
Merged as 9d765cc, with your commit and authorship intact. You were right, and I was wrong to close #2 the way I did. I checked that the proxy answered the handshake methods and wrote "Puppeteer and Playwright connect" — I had never run either one. Your test is what showed that, and both of your predictions were exact: Puppeteer stops on The What it took, past the two methods you named — I stopped guessing and diffed the wire against a raw Chromium:
Two things I changed from your version, both worth saying out loud:
I also wrote the strip list for those cookie fields against a live browser rather than the protocol docs, after the first version missed Thanks for filing this the way you did. The xfail was the right instrument: it made the gap impossible to close by assertion, which is precisely how I closed it the first time. |
Follow-up to #2. That issue was closed as fixed by the handshake answerer (be3d888), but a real-client check shows stock Puppeteer and Playwright still can't open a page (details in the issue thread). This adds the test that would have caught it, so the "point your framework at the bridge" claim stays honest as the answerer grows.
Why this test
handshake.test.tsasserts a syntheticBrowser.getVersionreply. It's green, but it drives a hand-built client, not a real one — so it can't see that a stock client gets pastgetVersionand then blocks. This drives the actual clients (puppeteer-core,playwright-core):connect → newPage → goto, which is the thing the README invites people to do.Why
it.failsAs of the answerer landing, a stock client:
getVersion—Target.getBrowserContexts(Puppeteer),Browser.setDownloadBehavior(Playwright);newPage(), because the proxy doesn't synthesise the target-lifecycle events (targetCreated/attachedToTarget/targetInfoChanged) the client waits for to build itsPage.So the body is the real acceptance test, marked
it.failsbecause it can't pass yet. When the answerer presents a coherent target lifecycle for a client's own pages, the body succeeds,it.failsturns the test red, and that's the signal to drop the.fails. It's a live tripwire, not a skipped aspiration.No new dependencies
A smoke test shouldn't pull Playwright's install into everyone's CI, so
puppeteer-core/playwright-coreare not added topackage.json. The test imports them by a name the type checker can't resolve and skips when they're absent (like the real-Chromium tests skip without Chrome). To run it:pnpm add -D -w puppeteer-core playwright-core pnpm test framework-connectVerified locally both ways: skips clean without the frameworks (full suite stays 23 files green), and passes as xfail with them installed. Typechecks under the test tsconfig.
Pairs with the compat discussion in #2 — merge whenever, or hold until the answerer work is scheduled; either way the tripwire is ready.
🤖 Generated with Claude Code