Skip to content

feat(helpers): add experimental Lightpanda helper - #5730

Open
DavertMik wants to merge 8 commits into
4.xfrom
feat/lightpanda-helper
Open

DavertMik wants to merge 8 commits into
4.xfrom
feat/lightpanda-helper

Conversation

@DavertMik

@DavertMik DavertMik commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

What

Adds an experimental Lightpanda helper that drives Lightpanda 1.0.0 over raw CDP, built on CDPBrowser the same way Obscura is.

helpers: {
  Lightpanda: { url: 'http://localhost:3000' },
}

The helper resolves the binary (binaryPath → LIGHTPANDA_PATH → lightpanda on PATH), starts lightpanda serve on a free port with LIGHTPANDA_DISABLE_TELEMETRY=true, and kills it when the run ends. Setting endpoint only attaches.

How

  • CDPBrowser now owns the server lifecycle. The spawn / free-port / wait-for-/json/version / SIGTERM→SIGKILL code moved out of Obscura.js unchanged and is driven by a small descriptor passed to _manageServer(config, { name, envVar, args, env, releases }). Obscura and Lightpanda are now presets plus a descriptor. All new paths are gated on that descriptor, so plain CDPBrowser and Kitesurf behave as before.
  • Lightpanda presets: input: 'synthetic', capabilities: { layout: 'real', screenshot: false }. Layout is pinned because the runtime probe (getComputedStyle(document.documentElement)) throws on Lightpanda's about:blank and would fail _before. Lightpanda paints nothing but does compute visibility-related styles and element boxes, so seeElement and the waitForVisible family work.
  • Bunoshfile.js: docsHelperMarkdown assumed doc[0] was the class. For a subclass with only a constructor, documentation.js sorts the config typedef first, which collapsed Obscura.md to 31 lines. It now picks the class by kind.

Results

Shared web API suite (test/helper/webapi.js), run locally:

Helper Passing Failing Skipped
Lightpanda 1.0.0 267 0 70
Obscura 0.2.0 (after the refactor) 258 0 76

Acceptance: 13 scenarios tagged @Lightpanda pass through the CLI. Unit suite: 834 passing.

Documented skips for Lightpanda, each with the reason inline:

  • TinyMCE inline, Trix, Monaco: editor never signals ready
  • scroll: block: no scrollable viewport, positions stay 0
  • #clickXY: nothing is painted, so coordinates are not hit-tested
  • CSS property tests (4): only the properties visibility checks need are computed
  • clipboard block: navigator.clipboard is unavailable
  • screencast block: now skipped for any helper with capabilities.screenshot === false

Coverage

CDPBrowser is abstract and is tested through its subclasses: the Obscura and Lightpanda workflows both run the shared web API suite and the acceptance scenarios, which exercise the relocated server lifecycle on every PR.

Lightpanda has no native Windows binary (WSL2 only), and its Linux binaries need glibc.

Docs

docs/alternative-browsers.md gains a "Try Lightpanda with your Playwright suite" walkthrough: install the binary, switch engines with one env var in the existing config, run, which Playwright features to tag out, and a CI snippet. The walkthrough was run as written against the test app.

CI

New lightpanda.yml workflow, mirroring obscura.yml: Lightpanda pinned to 1.0.0 and verified by SHA-256, runs the helper spec and the acceptance scenarios.

🤖 Generated with Claude Code

DavertMik and others added 8 commits October 3, 2026 00:08
…owser

Lightpanda is a thin CDPBrowser subclass that self-launches
`lightpanda serve` with telemetry disabled. The spawn/free-port/wait/kill
lifecycle moves from Obscura into CDPBrowser so both helpers share it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An eighth duplicated *Config typedef makes TypeScript report the conflicts
as one file-level error that @ts-ignore cannot suppress.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Install steps per engine and platform, one config to switch engines,
and latest-release download links instead of a hardcoded version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant