Rust-Only Runtime
Runs inside a single Rust process. No external browser, WebDriver, or Node.js dependency.
Open Source / Crate
browser-tester is a deterministic browser-like test runtime implemented in pure Rust. It validates DOM and event behavior without launching a real browser.
browser-tester focuses on predictable form/UI behavior tests rather than full browser rendering compatibility.
Runs inside a single Rust process. No external browser, WebDriver, or Node.js dependency.
Built for repeatable tests by design: fake clock, deterministic random seed, and explicit timer control APIs.
Supports practical browser-like flows: selectors, inline script execution, event propagation, and DOM updates.
Fast feedback cycle for form-centric UI tests, while keeping failure output focused on selectors and expected/actual values.
Create a harness from HTML, run interactions, and assert DOM results. Start with a small fixture and expand with timer/mock APIs.
Install
cargo add browser_tester
Basic Example
Core DOM test operations: Harness::from_html, type_text, set_checked, click, submit, and assertion helpers for text/value/checked/existence.
Control asynchronous behavior with a fake clock. Advance time deterministically using advance_time, advance_time_to, flush, and timer inspection APIs.
Inject fetch responses and dialog outcomes with set_fetch_mock, enqueue_confirm_response, and enqueue_prompt_response to keep tests isolated.
Enable trace logs and extract event/timer flow when a test fails. Useful for debugging event order and default action behavior.
If you need additional browser APIs for your test suite, open an issue with a minimal fixture to discuss scope and priority.