Skip to content

feat(helpers): add experimental Moli CDP helper - #5753

Open
DavertMik wants to merge 2 commits into
4.xfrom
feat/moli-helper
Open

DavertMik wants to merge 2 commits into
4.xfrom
feat/moli-helper

Conversation

@DavertMik

Copy link
Copy Markdown
Contributor

Adds an experimental Moli helper driving Moli, a Rust headless browser (V8 + Servo's Stylo) served over CDP. Implemented like Lightpanda: a thin CDPBrowser subclass that pins presets and manages the moli serve process (self-launch on a free port, attach via endpoint, or courtesy-attach to :9222).

Why no --layout

With moli serve --layout, element geometry is a snapshot frozen on first read. After a DOM change (a display toggle, a newly appended node) boxes stay 0×0 until Page.captureScreenshot rebuilds the layout. That broke waitForVisible and waitForText (35 webapi failures). Default mode uses placeholder boxes that follow display and visibility live, so visibility checks work and only 6 tests need skipping.

The runtime layout probe reports real, because Stylo computes styles, and would pick CDP coordinate input, which Moli rejects without layout. So the helper pins the presets: input: 'synthetic', capabilities.layout: 'real', capabilities.screenshot: false.

Changes

  • lib/helper/Moli.js and the generated docs/helpers/Moli.md
  • test/helper/CDPBrowser_moli_test.js (shared webapi suite + spawn lifecycle)
  • test/helper/webapi.js: Moli skips with verified reasons:
    • clickXY ×3: no coordinate input without layout
    • attachFile ×2: DOM.setFileInputFiles gives the file an empty type, so it posts as application/octet-stream
    • seeCssPropertiesOnElements: links compute color: rgb(0, 0, 0)
  • test/acceptance/codecept.Moli.js; @Moli added to the @Lightpanda scenarios and to 4 gherkin features
  • .github/workflows/moli.yml: v1.1.17 pinned with a SHA256 check
  • Wiring: STANDARD_ACTING_HELPERS, Decision/pause messages, Bunoshfile.js, typings/fixDefFiles.js, npm script test:unit:webbapi:moli
  • Docs: alternative-browsers.md, installation.md, README

Local results

Moli Lightpanda Obscura Chrome (CDPBrowser)
webapi passing / pending 289 / 50 269 / 70 260 / 76 309 / 39
acceptance 19 passed, 4.8 s 13 passed, 3.4 s 19 passed, 9.0 s —
startup to ready 13 ms 20 ms 14 ms 177 ms
median form-flow iteration 60 ms 62 ms 127 ms 185 ms
browser CPU, 30 iterations 1.9 s 2.2 s 3.5 s 10.7 s
peak memory (PSS) 101 MiB 40 MiB 49 MiB 548 MiB

Versions are the CI-pinned ones (Lightpanda 1.0.0, Obscura 0.2.2, Chrome 144 headless). The iteration loop fills and submits a form, ticks a checkbox, selects an option, clicks a link and reads text; 3 rounds of 30 iterations each.

🤖 Generated with Claude Code

Moli (https://github.com/lexmount/moli) is a Rust headless browser with V8
and Stylo, served over CDP. The helper is a thin CDPBrowser subclass like
Lightpanda: it self-launches `moli serve` on a free port, or attaches to an
explicit endpoint.

Moli runs without --layout on purpose: with --layout element geometry is
frozen on first read and only a screenshot refreshes it, which breaks
waitForVisible/waitForText. Presets pin synthetic input, layout 'real' and
no screenshots, since the runtime probe would otherwise pick coordinate
input that Moli rejects in this mode.

- shared webapi suite: 289 passing, 50 pending; 6 tests skipped with
  verified reasons (clickXY, upload MIME type, link color)
- 19 acceptance scenarios tagged @Moli, including gherkin features
- CI workflow pinned to v1.1.17 with SHA256 check
- docs: alternative browsers, installation, README, helper reference

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DavertMik
DavertMik requested a review from DenysKuchma October 13, 2026 23:37
The mocha adapter uses Mocha.utils.inherits, removed in mocha 12.

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