4 Commits
Author SHA1 Message Date
Pierre Tachoire bb905ad978 test(browser): convert Lightpanda gap test to positive Snapshot+Eval coverage
Lightpanda upstream merged the AX-tree nodeId fix in
lightpanda-io/browser#2232. The TestLightpanda_KnownUpstreamGaps canary
fired on the latest image, so:

- Rename to TestLightpanda_Snapshot_AndEval and assert the snapshot
  returns refs + non-empty text (instead of asserting it fails).
- Flip AX-snapshot in the compatibility matrix from gap to fully
  supported. Replace the "Known upstream gap" section with a
  "Minimum Lightpanda version" note pointing at the upstream PR.
2026-07-01 10:23:27 +02:00
Pierre Tachoire 62e8359a21 fix(browser): correct Lightpanda Eval claims + add missing compose command
- Eval works on Lightpanda when called with go-rod's expected function
  form (e.g. "() => document.title"); only bare expressions fail, and
  they fail on Chrome too. Fix the integration gap test and docs that
  incorrectly attributed this to a Lightpanda bug.
- docker-compose.lightpanda.yml: add the missing
  command: lightpanda serve ... — the image's entrypoint isn't
  lightpanda, so without an explicit command the sidecar wouldn't
  start.
2026-07-01 10:23:24 +02:00
Pierre Tachoire 4147fee4e5 fix(browser): make Lightpanda backend usable end-to-end
Live testing surfaced three issues:

- Lightpanda numbers targets per-browser, and each conn is its own
  browser, so every tab gets the same upstream targetID
  ("FID-0000000001"). Synthesize globally-unique "lp-N" keys for our
  internal map so multi-tenant tab tracking works.
- page.Info() returns valid data once post-open then errors on
  subsequent calls, which made ListTabs silently drop tabs. Cache URL
  and Title at OpenTab time and read from the cache in ListTabs.
- rod.Browser.Close() calls Browser.close which Lightpanda doesn't
  implement; the WS drops cleanly anyway. Swallow the error to quiet
  the noisy log line.

Two Lightpanda upstream bugs are documented in docs/browser-backends.md
and exercised by TestLightpanda_KnownUpstreamGaps:
  1. Accessibility.getFullAXTree returns nodeId as a JSON number
     (CDP spec: string)
  2. Runtime.evaluate rejects go-rod's function-apply wrapper
2026-07-01 10:23:20 +02:00
Pierre Tachoire 2e35a3faac test(browser): add Lightpanda integration tests
Build-tag gated (//go:build integration), skipped unless
LIGHTPANDA_CDP_URL env is set. Covers:

- Golden path: open → snapshot → list → close
- Multi-tenant isolation: each tenant sees only its own tabs;
  cross-tenant CloseTab is rejected
- Backend() reports lightpanda after Start
- Screenshot tool action returns an IsError result mentioning
  lightpanda + snapshot
2026-07-01 10:23:13 +02:00