Tristan Peralta

Libraries 2026

Playwright for Elixir

Browser automation for Elixir, driven by Playwright's own protocol.

Playwright for Elixir brings Playwright’s browser automation to the BEAM: one API for Chromium, Firefox, and WebKit, with contexts, pages, frames, locators, network interception, and tracing. The Elixir library speaks Playwright’s driver protocol rather than wrapping a Node.js process, which keeps the runtime small and the API close to the original.

What I work on

The project is a collaboration; my work sits in the transport and the API surface. I replaced the gun/cowlib WebSocket transport with Mint.WebSocket, which removed a large dependency and made reconnects predictable. I added worker events, storageState with IndexedDB, console and page-error collection, JS/CSS coverage, WebSocket routing, locator handlers, CDP sessions, and the Page methods that the upstream JavaScript API had but the Elixir binding did not.

Parity as a discipline

Browser automation APIs drift. Each Playwright release adds methods, deprecates others, and changes option shapes. The binding tracks that with a feature-parity document, a versioned upgrade pass, and tests that are unskipped only when the behaviour is real. The package is still alpha: parity is close, not complete, and the README says so.

Why it matters on the BEAM

End-to-end tests usually live outside the application, in a Node process with its own toolchain. A native Elixir binding lets the test suite share the same runtime as the app, start browsers from mix test, and assert on browser state in the same process that owns the test database.