leptos-browser-test
Leptos test-app launcher for browser-driven integration tests.
This crate owns the cargo leptos serve / cargo leptos watch process management for a crate-local Leptos test app.
It waits until the app is listening and keeps recent stdout/stderr for useful startup failures.
It intentionally leaves browser/WebDriver orchestration to the test harness that uses the returned base URL. Use
app.base_url() with browser-test, Playwright, Selenium, thirtyfour, or any other integration-test harness.
Runtime requirements
LeptosTestApp terminates the managed cargo leptos process when it is dropped. This uses
tokio_process_tools::TerminateOnDrop, so Tokio browser tests must use a multi-threaded runtime:
#[tokio::test(flavor = "multi_thread")].
use ;
async
async
Report::into_dynamic erases the typed Report<LeptosBrowserTestError> into a generic Report so it can compose with
the test harness's own error type.
Typical browser-test usage starts the app, passes its base URL into the runner context, and lets drop-based cleanup
handle the app process after BrowserTestRunner::run(...) returns:
use ;
use ;
async
For apps served over HTTPS, add the scheme override before starting:
use ;
async
For local manual debugging, run the integration test target from the consuming crate and enable whatever visibility or pause flags the browser harness supports: