Repository navigation
Dioxus 'external' provider: enable it on Windows and Linux #713
Description
Goal
Make driverProvider: 'external' work with @wdio/dioxus-service on Windows and Linux. It has never worked: the launcher only starts the embedded provider (launcher.ts: "wdio-dioxus-driver spawning wired in a follow-on commit"), and the Dioxus E2E workflow's external leg is marked "not implemented in v1". Since #703, choosing 'external' fails at startup on every platform, and the docs describe the embedded provider only.
macOS is out of scope: there's no WebDriver for an embedded WKWebView.
Why
Real input. The embedded driver runs everything as page JavaScript: clicks via elementFromPoint plus synthetic events, setValue via el.value += …. Those events have isTrusted: false, and WebView2 refuses untrusted input at some checks (the Tauri equivalent is #612). msedgedriver and WebKitWebDriver send real input. #720 would fix keys inside the embedded driver instead, through WebView2's DevTools Protocol (as #620 does for Tauri). If it lands, external only matters on Windows if clicks need real input too.
msedgedriver would also give Windows real screenshots, alerts, printing and frames, which the embedded driver lacks (#721). Most of those can be fixed inside the embedded driver once it has a native webview handle, the same prerequisite as #720.
The cost: keeping msedgedriver in step with the installed WebView2 has been expensive for Tauri (the Edge 150 elevated-host regression and #637, fixed-version WebView2 in #539). Embedded already covers all three platforms, and Tauri made embedded its default (ADR 0002).
App side (done in #717)
Apps call wdio_dioxus::install(config) whichever provider runs. wdio-dioxus-driver sets WDIO_DIOXUS_PROVIDER=external next to DIOXUS_WEBVIEW_AUTOMATION=true; the platform driver passes both to the app it launches, and install() then installs the bridge without the embedded server. Design: comment below.
Windows
Not blocked by Dioxus: msedgedriver attaches to WebView2 without the app's cooperation, as with tauri-driver.
- Launcher: start
wdio-dioxus-driver(and msedgedriver) per instance, including multiremote. Reuse the Tauri service's driver-process and Edge-driver management, ideally moved into@wdio/native-corerather than copied. - Wire up
autoInstallDioxusDriver,autoDownloadEdgeDriveranddioxusDriverPath, which are declared but never read. - Add a Windows
'external'leg to_ci-e2e-dioxus-all-providers.reusable.yml(e2e/wdio.dioxus.conf.tsalready has the config).
Linux
Blocked upstream. WebKitWebDriver only drives a WebKit context that has automation allowed, and a Dioxus app has no way to allow it:
-
Wry has the switch:
WebContext::set_allows_automation(flag)(wry/src/webkitgtk/web_context.rs, which callswebkit_web_context_set_automation_allowed). -
Tauri flips it when
TAURI_WEBVIEW_AUTOMATION=true(tauri-runtime-wry/src/lib.rs), which is whytauri-driverworks on Linux. -
dioxus-desktop0.7.10 builds its ownWebContext(src/webview.rs:260,WebContext::new(cfg.data_dir.clone())). It never callsset_allows_automationand doesn't expose the context throughConfig. -
Upstream (DioxusLabs/dioxus): a small opt-in, in the same shape as our
Config::with_background_throttlingPR (feat(desktop): expose Config::with_background_throttling to opt out of WKWebView WebContent suspension DioxusLabs/dioxus#5587):Config::with_automation(bool)applied to theWebContextbefore the webview is built, or an env var as Tauri does. -
Once released, call it from
wdio-dioxuswhenWDIO_DIOXUS_PROVIDER=external. -
Drop the Linux block in
wdio-dioxus-driver(README) and in the launcher (linuxExternalProviderUnsupported). -
Add a Linux
'external'leg to the Dioxus E2E workflow.
Both
- Remove the
'external'fail-fast inonPreparefor the supported platform(s). - Document the provider: configuration, platform support, and an Edge WebDriver page for Windows (fix(dioxus): make the setup docs and errors match what v1 supports (embedded driver only) #703 removed the old one; it's in git history).
If we decide not to do this after all: remove 'external' from DioxusDriverProvider, the three options and the e2e config, and deprecate wdio-dioxus-driver on crates.io.
Replaces #712, which tracked Linux separately.
Activity
fix(dioxus): fail fast on the 'external' provider everywhere and say …
goosewobbler commentedon Oct 8, 2026
Plan for the "implement" path: one crate for apps, provider chosen at runtime
Apps add one crate and call one
install(). Embedded vs external stays a test-config choice; switching doesn't touchmain.rs.Crates
wdio-dioxus(new, the crate apps add):install(config), plus re-exports ofautomation,window_stateanddeeplink(today the last two need the bridge as a direct dependency). Depends onwdio-dioxus-bridge, and onwdio-dioxus-embedded-driverbehind a defaultembeddedfeature.wdio-dioxus-bridgeandwdio-dioxus-embedded-driverbecome internal. The embedded driver stays published, so apps already on it keep working.wdio-dioxus-driverstays a separate binary, never linked into the app. It setsWDIO_DIOXUS_PROVIDER=externalnext toDIOXUS_WEBVIEW_AUTOMATION.install()decides from the environment the service and the driver set:install()DIOXUS_WEBVIEW_AUTOMATIONWDIO_EMBEDDED_PORT(default 4444)WDIO_DIOXUS_PROVIDER=externalbrowser.dioxus.*Embedded is the default, so a hand launch needs only one variable. Bridge-only is opt-in from the external side: the platform driver passes the driver's environment to the app it launches, as it already does for
DIOXUS_WEBVIEW_AUTOMATION. Without the opt-in, the app would start an unused server, run the polling loop and override the data directory.Updated during #717's review: the first version of this plan chose bridge-only whenever
WDIO_EMBEDDED_PORTwas missing, which meant a hand launch needed both variables.Release:
wdio-dioxusis a standalone crate, so it needs adding to releasekit'sdioxusversion group.Timing: the crate name goes into create-wdio's setup banner and the webdriver.io docs, so settle it before the upstream docs PR.
[-]Dioxus 'external' provider on Windows: start wdio-dioxus-driver from the launcher (or drop the provider)[/-][+]Dioxus 'external' provider: enable it on Windows and Linux[/+]docs(dioxus): document the embedded setup only
fix(dioxus): make the setup docs and errors match what v1 supports (e…