Browser Mode
Browser mode lets you test your Dioxus frontend UI in plain Chrome against a running dev server — no Dioxus binary, no driver. The Dioxus invoke API is intercepted at the JavaScript boundary in the renderer, so you can mock individual commands and assert on call arguments just like in native mode.
Overview
What Is It?
Browser mode is a frontend-only test mode. Your frontend code runs for real in Chrome; the Dioxus Rust backend is replaced by mocks you define per command. Same WDIO API, same frontend code path — the only thing that changes is what's on the other end of invoke(...).
In normal (native) mode the service launches your compiled Dioxus app, drives it via the configured driver provider, and communicates with the backend through the bridge. Browser mode replaces all of that with a standard Chrome session: it sets browserName to 'chrome', navigates to your dev server URL, and injects a lightweight script that patches the invoke API so your Dioxus commands can be intercepted in tests.
Why Use It?
- No build step needed — point the service at a dev server and start testing immediately.
- Fast feedback — no Dioxus startup, no Rust compilation, no driver negotiation.
- Standard browser devtools — Chrome DevTools and HMR work as normal during development.
When to Use It
Browser mode is the right choice when your tests are renderer-focused: asserting UI state, verifying that components call the correct Dioxus commands with the right arguments, or checking that the renderer handles mock responses correctly.
It is not suitable when your tests need to:
- Call
browser.dioxus.execute()to run code with access to the bridge - Test window management with
browser.dioxus.switchWindow()orbrowser.dioxus.listWindows() - Use
browser.dioxus.triggerDeeplink() - Assert on real command round-trips to a running Rust backend
For those scenarios use native mode (the default).