You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7520437
Browse filesBrowse the repository at this point in the historyBrowse files
feat(helpers): add Lightpanda helper, share server lifecycle in CDPBrowser
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>
Copy file name to clipboardExpand all lines: README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,7 @@
11
11
| 🌐 Web | Puppeteer |[](https://github.com/codeceptjs/CodeceptJS/actions/workflows/puppeteer.yml)|
12
12
| 🌐 Web | WebDriver |[](https://github.com/codeceptjs/CodeceptJS/actions/workflows/webdriver.yml)|
13
13
| 🌐 Web | Obscura |[](https://github.com/codeceptjs/CodeceptJS/actions/workflows/obscura.yml)|
14
+
| 🌐 Web | Lightpanda |[](https://github.com/codeceptjs/CodeceptJS/actions/workflows/lightpanda.yml)|
14
15
| 📱 Mobile | Appium |[](https://github.com/codeceptjs/CodeceptJS/actions/workflows/appium_Android.yml)|
15
16
16
17
# CodeceptJS [](https://stand-with-ukraine.pp.ua)
@@ -44,6 +45,7 @@ CodeceptJS uses **Helper** modules to provide actions to `I` object. Currently,
44
45
-[**Puppeteer**](https://github.com/codeceptjs/CodeceptJS/blob/master/docs/helpers/Puppeteer.md) - uses Google Chrome's Puppeteer for fast headless testing.
45
46
-[**WebDriver**](https://github.com/codeceptjs/CodeceptJS/blob/master/docs/helpers/WebDriver.md) - uses [webdriverio](http://webdriver.io/) to run tests via WebDriver or Devtools protocol.
46
47
-[**Obscura**](https://codecept.io/helpers/Obscura) - drives the lightweight Obscura browser through Chrome DevTools Protocol. See [Alternative Browser Engines](https://codecept.io/alternative-browsers).
48
+
-[**Lightpanda**](https://codecept.io/helpers/Lightpanda) - drives the Lightpanda headless browser through Chrome DevTools Protocol. See [Alternative Browser Engines](https://codecept.io/alternative-browsers).
47
49
-[**Appium**](https://github.com/codeceptjs/CodeceptJS/blob/master/docs/helpers/Appium.md) - for **mobile testing** with Appium
48
50
-[**Detox**](https://github.com/codeceptjs/CodeceptJS/blob/master/docs/helpers/Detox.md) - This is a wrapper on top of Detox library, aimed to unify testing experience for CodeceptJS framework. Detox provides a grey box testing for mobile applications, playing especially well for React Native apps.
Copy file name to clipboardExpand all lines: docs/alternative-browsers.md
+43-16Lines changed: 43 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ title: Alternative Browser Engines
6
6
# Alternative Browser Engines
7
7
8
8
::: warning Experimental
9
-
The `Obscura` and `Kitesurf` helpers are experimental in CodeceptJS 4.2. Pin browser versions in CI and retain Playwright or WebDriver coverage for compatibility-critical tests.
9
+
The `Obscura`, `Lightpanda` and `Kitesurf` helpers are experimental in CodeceptJS 4.2. Pin browser versions in CI and retain Playwright or WebDriver coverage for compatibility-critical tests.
10
10
:::
11
11
12
12
Playwright and Puppeteer drive full Chromium — the most accurate way to test what users see.
@@ -17,11 +17,15 @@ through dedicated helpers:
17
17
V8 engine. From v0.2.0, the default release build also renders — real layout, computed styles,
18
18
and screenshots — with `-no-render` builds still available for pure-speed, nothing-painted
19
19
scraping mode. Release archives are available for Linux, macOS, and Windows.
20
+
-**[Lightpanda](https://lightpanda.io)** — an open-source browser written from scratch in Zig for
21
+
automation, with a real V8 engine and broad Web API coverage. It never paints: no screenshots,
22
+
but it does compute enough style and layout for visibility checks. Binaries are available for
23
+
Linux and macOS.
20
24
-**[Kitesurf](https://blog.cloudflare.com/kitesurf/)** — Cloudflare's browser that runs in V8
21
25
isolates on Cloudflare Workers, with a real layout and rendering pipeline. Cloud-only,
22
26
free in beta, planned to be open-sourced.
23
27
24
-
Both speak Chrome DevTools Protocol. CodeceptJS drives them with raw CDP — one round-trip per
28
+
All of them speak Chrome DevTools Protocol. CodeceptJS drives them with raw CDP — one round-trip per
25
29
action, no stale element handles — which is why suites on these browsers run fast and never hang
26
30
on navigation races.
27
31
@@ -56,6 +60,10 @@ redirect happens, cookie is set — do not need a GPU raster pipeline. Obscura e
56
60
app's real JavaScript in real V8; it only skips painting. For API-adjacent flows
57
61
(login → dashboard data appears), that is exactly the right amount of browser.
58
62
63
+
Lightpanda takes the same trade further: it has no rendering pipeline at all, which is what makes
64
+
it start in milliseconds and use a fraction of Chromium's memory. Pick it when the suite never
65
+
needs a screenshot; pick Obscura when it does.
66
+
59
67
**Constrained environments.** ARM CI runners, thin containers, air-gapped machines:
60
68
a static binary with no system dependencies goes where Chromium will not.
61
69
@@ -64,7 +72,9 @@ as an Obscura capability rather than a browser-compatibility guarantee from Code
64
72
65
73
## When to stay with Playwright
66
74
67
-
- Anything visual: visual regression, PDF (neither helper exposes PDF output). Obscura's v0.2.0+
75
+
- Anything visual: visual regression, PDF (none of these helpers exposes PDF output). Lightpanda
76
+
has no screenshots at all, no scrolling, and only computes the CSS properties visibility checks
77
+
need. Obscura's v0.2.0+
68
78
rendering/CSS engine is new and independently implemented — expect edge cases and gaps versus a
69
79
real browser, especially around inherited properties and less common computed-style values.
70
80
- Visibility semantics on `-no-render` Obscura builds (and v0.1.x): every element reports as
@@ -88,6 +98,12 @@ CodeceptJS 4.2 is tested in CI with Obscura 0.2.2. Obscura 0.2.x is recommended;
88
98
},
89
99
}
90
100
101
+
helpers: {
102
+
Lightpanda: {
103
+
url: 'http://localhost:3000',
104
+
},
105
+
}
106
+
91
107
helpers: {
92
108
Kitesurf: {
93
109
url: 'https://staging.myapp.com',
@@ -131,18 +147,29 @@ process — there is nothing to start by hand in the common case:
131
147
that "start Obscura by hand and just run the tests" keeps working without any config, while
132
148
self-launch is still the default for everyone else.
133
149
150
+
### Lightpanda's connection modes
151
+
152
+
Lightpanda works the same way, with `lightpanda` in place of `obscura`: the binary is resolved
153
+
from `binaryPath`, then `LIGHTPANDA_PATH`, then `lightpanda` on `PATH`, and `lightpanda serve` is
154
+
started on a free port and stopped when the run ends. Setting `endpoint` attaches to an instance
155
+
you manage yourself, for example the `lightpanda/browser` Docker image. CodeceptJS is tested in CI
156
+
with Lightpanda 1.0.0; see [Installation](/installation#lightpanda-experimental).
157
+
158
+
The helper always starts Lightpanda with `LIGHTPANDA_DISABLE_TELEMETRY=true`. When you start the
| Screenshots | yes | yes (v0.2.0+ default builds); no on `-no-render`/v0.1.x | yes |
141
-
| Visibility assertions | yes | yes (v0.2.0+ default builds); no, DOM-presence only, on `-no-render`/v0.1.x | yes |
142
-
| Screencast / video (`screencast` plugin) | yes — WebM via `page.screencast`, with caption burn-in | yes — APNG via CDP `Page.startScreencast`, assembled in-process (v0.2.0+ default builds; verified PNG frames on the live server); no caption burn-in | untested |
143
-
| Startup model | local browser process | standalone local binary | remote cloud session |
| Screenshots | yes | yes (v0.2.0+ default builds); no on `-no-render`/v0.1.x |no |yes |
168
+
| Visibility assertions | yes | yes (v0.2.0+ default builds); no, DOM-presence only, on `-no-render`/v0.1.x | yes | yes |
169
+
| Screencast / video (`screencast` plugin) | yes — WebM via `page.screencast`, with caption burn-in | yes — APNG via CDP `Page.startScreencast`, assembled in-process (v0.2.0+ default builds; verified PNG frames on the live server); no caption burn-in |no |untested |
170
+
| Startup model | local browser process | standalone local binary |standalone local binary |remote cloud session |
0 commit comments