Skip to content

navidemad/capybara-lightpanda

Repository files navigation

Capybara::Lightpanda

Gem version Total downloads Tests Rails compatible Turbo friendly

A Capybara driver for Lightpanda, the fast headless browser built in Zig.
Self-contained — built-in CDP client, no external browser-client gem required.

Capybara  →  capybara-lightpanda  →  Lightpanda GitHub stars

Capybara::Lightpanda — faster system tests for Rails, without Chromium Configuration · dual-driver setups · Turbo Rails · capability matrix · beta-testing guide

Read the docs

Install

Add this to your Gemfile and run bundle install:

group :test do
  gem "capybara-lightpanda"
end

In your test setup:

require "capybara-lightpanda"
Capybara.javascript_driver = :lightpanda

# Rails system tests don't read Capybara.javascript_driver — use driven_by:
driven_by :lightpanda

Tip

The Lightpanda binary is auto-downloaded on first use — no separate install step needed.

Important

Lightpanda is a headless agentic browser, not a layout engine. External <link rel="stylesheet"> are fetched and applied (the gem enables this by default), but @media rules and window.matchMedia() evaluate against a fixed 1920×1080 viewport — there is no resize emulation. Any spec whose visibility depends on a non-desktop viewport — for example a mobile-only CTA shown via @media (max-width: …) — should stay on Cuprite (or whichever full-browser driver you were already using). The dual-driver setup routes the layout-sensitive minority to Cuprite and the structural majority to Lightpanda for speed.

Credits

Patterns adapted from these MIT-licensed projects (cookies API, frame switching, node call/error conventions, retry/event utilities) are acknowledged with the original copyright notices in NOTICE.md.

Contributing

Bug reports and pull requests are welcome on GitHub.
For beta-testing tips and how to file useful feedback, see BETA_TESTING.md.

License

MIT License

About

Run Capybara system tests on Lightpanda — the ultra-fast headless browser built in Zig.

Resources

License

Stars

4 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors