About this project

playwright-rs is a Rust crate that drives Microsoft Playwright from Rust using async/await and Tokio. It presents a high-level, type-safe Rust API while communicating over JSON-RPC with the same Node.js-based Playwright server used by official language bindings, leaving browser automation and cross-browser protocol handling to the upstream Playwright project. The project is pre-1.0 but states that it has reached parity with the Playwright Python API and is focused on dogfooding, API polish, and performance before a stable release. It supports Chromium, Firefox, and WebKit, with CI testing on Linux, macOS, and Windows. The API includes Rust-oriented features such as Result-based error handling, option builders, and a compile-time-validated locator macro. Typical workflows include launching browsers, creating pages, navigating to URLs, using auto-waiting locators, reading response JSON, and capturing traces. Additional crate features support serving an application under test from the test process, trace-zip parsing, screenshot-diff assertions, TLS and crypto backend selection, and a standalone browser-installer CLI. The crate also provides Browser::bind and Browser::unbind for exposing a Rust-launched browser to external clients such as the Playwright MCP package, CLI tools, or agent tooling. Browser binaries are installed through the crate so that they match the bundled Playwright driver. The driver is assembled during the first build and includes its own Node.js runtime; environment variables are available to skip downloads or configure caching. The repository also ships an Agent Skill for compatible AI coding tools, with guidance on dependencies, browser installation, the object model, builders, locators, auto-waiting, and trace capture. A documented limitation is that WebKit launch_persistent_context does not work on native Windows because of an upstream Playwright issue; non-persistent WebKit works there, and persistent contexts can use WSL, macOS, or Linux. The software is licensed under Apache-2.0.