Skip to content

Dioxus 'external' provider: enable it on Windows and Linux #713

Open

Description

@goosewobbler

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-core rather than copied.
  • Wire up autoInstallDioxusDriver, autoDownloadEdgeDriver and dioxusDriverPath, which are declared but never read.
  • Add a Windows 'external' leg to _ci-e2e-dioxus-all-providers.reusable.yml (e2e/wdio.dioxus.conf.ts already 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 calls webkit_web_context_set_automation_allowed).

  • Tauri flips it when TAURI_WEBVIEW_AUTOMATION=true (tauri-runtime-wry/src/lib.rs), which is why tauri-driver works on Linux.

  • dioxus-desktop 0.7.10 builds its own WebContext (src/webview.rs:260, WebContext::new(cfg.data_dir.clone())). It never calls set_allows_automation and doesn't expose the context through Config.

  • Upstream (DioxusLabs/dioxus): a small opt-in, in the same shape as our Config::with_background_throttling PR (feat(desktop): expose Config::with_background_throttling to opt out of WKWebView WebContent suspension DioxusLabs/dioxus#5587): Config::with_automation(bool) applied to the WebContext before the webview is built, or an env var as Tauri does.

  • Once released, call it from wdio-dioxus when WDIO_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

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

  1. goosewobbler commented on Oct 8, 2026

    @goosewobbler
    ContributorAuthor

    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 touch main.rs.

    Crates

    • wdio-dioxus (new, the crate apps add): install(config), plus re-exports of automation, window_state and deeplink (today the last two need the bridge as a direct dependency). Depends on wdio-dioxus-bridge, and on wdio-dioxus-embedded-driver behind a default embedded feature.
    • wdio-dioxus-bridge and wdio-dioxus-embedded-driver become internal. The embedded driver stays published, so apps already on it keep working.
    • wdio-dioxus-driver stays a separate binary, never linked into the app. It sets WDIO_DIOXUS_PROVIDER=external next to DIOXUS_WEBVIEW_AUTOMATION.

    install() decides from the environment the service and the driver set:

    Environment install()
    no DIOXUS_WEBVIEW_AUTOMATION nothing (#710)
    automation bridge + embedded server, on WDIO_EMBEDDED_PORT (default 4444)
    automation + WDIO_DIOXUS_PROVIDER=external bridge only: msedgedriver runs execute and input, the bridge serves browser.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_PORT was missing, which meant a hand launch needed both variables.

    Release: wdio-dioxus is a standalone crate, so it needs adding to releasekit's dioxus version 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.

  2. changed the title [-]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[/+] on Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope:dioxusDioxus service, bridge, and driverstype:enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions