CDP / Playwright smoke
Run the committed smoke with:
mise install
just cdp-playwright-smoke
The script starts vixen-headless --cdp, connects with playwright-core, and
exercises:
- Playwright's
chromium.connectOverCDP(...)handshake. Runtime.enable,Page.enable,Network.enable,Target.getTargets,Page.getFrameTree.Page.navigateto a local fixture with a button click listener, including Playwrightpage.addInitScript()execution before page scripts.Runtime.evaluate/Runtime.awaitPromisefor DOM reads and promise handles.- CDP DOM query plumbing:
DOM.getDocument,DOM.querySelector,DOM.querySelectorAll,DOM.describeNode, andDOM.resolveNode. - Top-level navigation network notifications:
Network.requestWillBeSent,Network.responseReceived, andNetwork.loadingFinished; lifecycle opt-in observesinit/commit/DOMContentLoaded/load. Input.dispatchMouseEventwithmousePressedthenmouseReleasedover the button.- The click handler mutates
textContent, attributes/classes, inline style, and a smallcreateElement/appendChild/removeChild/replaceChildrenstructural subtree; laterRuntime.evaluatecalls read those mutations back. - Observe
Runtime.consoleAPICalled, then callPage.captureScreenshot(png) and Playwright's high-levelpage.screenshot()path. - Playwright
page.setViewportSize()plus CDPPage.getLayoutMetricsviewport reporting, page-level viewport globals, andpage.emulateMedia()updates tomatchMedia()for media type/color scheme. - Exercise high-level locator geometry/click/fill APIs over Vixen's minimal
DOM.describeNode/DOM.resolveNode/DOM.getContentQuadsbacking. The smoke also coverslocator.hover()mouse lifecycle events,locator.dblclick()click/detail ordering, right-clickcontextmenu,page.mouse.wheel()wheel-event deltas,getByRole()button lookup by accessible text,getByLabel()lookup/check/select/fill through DOM label/control associations, high-level Playwright keyboard input against a clicked form control, andlocator.setInputFiles()against a file input. - Submit a form through Playwright's high-level locator click and wait for the resulting URL/title navigation.
- Traverse session history with Playwright
page.goBack()/page.goForward()and refresh withpage.reload(). - Replace document content with Playwright
page.setContent(). - Execute/apply dynamic inline scripts and styles inserted by Playwright
page.addScriptTag()/page.addStyleTag(). - Deliver exposed function calls through Playwright
page.exposeFunction(). - Create and close additional pages with Playwright
context.newPage()/page.close(). - Read object properties through Playwright
JSHandle.getProperty(). - Surface modal dialogs through Playwright's
dialogevent. - Replace and clear browser-context permission grants through Playwright
context.grantPermissions()/context.clearPermissions(), with runtimePermissionStatusreads observing the override without rewriting profile decisions. - Start/stop Chromium tracing through Playwright
browser.startTracing()/browser.stopTracing(), read the bounded JSON trace throughIO.read, and verify stablecdp.method-not-founderrors for unsupported methods.
Rust CDP tests additionally cover browser-shaped automation methods used by
Playwright/DevTools probes: idle Page.stopLoading,
Page.resetNavigationHistory,
Page.getResourceTree, Page.getResourceContent, Page.setBypassCSP as a
CDP-scoped script-CSP override for later navigations,
Network.setCacheDisabled bypassing runtime fetch() cache reads/writes,
Network.setBypassServiceWorker,
Network.setExtraHTTPHeaders propagation into runtime fetch(),
Performance.getMetrics, Security.getSecurityState, and DOM
attribute/outerHTML read-write methods, exact/wildcard permission override
scopes, detached-session rejection, stable protocol error data, and the bounded
4,096-event tracing buffer.
Current limits are intentional: one main frame per independently scripted target,
PNG screenshots only, Chromium JSON tracing only (not Playwright context trace
archives), synchronous per-request lifecycle waiting (therefore idle-only
protocol stop-loading acknowledgement), and full-viewport mouse hit testing.
BrowserCore itself has active source cancellation and stale-completion race tests;
CDP needs an asynchronous event pump before the same connection can race
Page.navigate with Page.stopLoading. Add methods only when this smoke shows a
real automation gap.