Skip to content

test(tauri,dioxus): press Enter on a form whose submit isn't cancelled - #1009

Open
goosewobbler wants to merge 4 commits into
mainfrom
test/uncancelled-submit-991
Open

goosewobbler wants to merge 4 commits into
mainfrom
test/uncancelled-submit-991

Conversation

@goosewobbler

@goosewobbler goosewobbler commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Description

Every E2E form cancelled its submit, so CI never ran Enter on a form that navigates, the path a login form takes. This adds those tests to both embedded drivers.

Tauri (special-keys.embedded.spec.ts)

  • Two tests, one for addValue('x' + Key.Enter) and one for browser.keys(Key.Enter). Each checks that the key action resolves, waits until location.search is the form's query, then checks that a marker global set before the submit is gone, so the page really reloaded, as in Chrome.
  • The waits use getUrl(), because the driver's execute can lose its result when the page navigates (tauri: an execute script that navigates waits out the script timeout #1012).
  • Embedded mode shares one app across specs, so afterEach goes back to the URL the spec started on with browser.url() and waits for the page to load.
  • The tests sit in a nested describe next to the other Enter tests. Mocha runs a nested suite after the suite's own tests, so they run last in the spec.
  • The issue suggests restoring with location.replace(location.pathname). On macOS and Linux the URL is tauri://localhost, whose path is empty, so that would reload ?q=x.

Dioxus (element-events.embedded.spec.ts)

  • Checks that the page doesn't navigate: Enter, in addValue and in key actions, fires submit each time and both actions resolve. Then a one-second wait for a navigation times out, location.search stays '' and the marker stays.
  • The page can't navigate because dioxus-desktop's navigation handler allows a dioxus:// or http(s)://dioxus. URL only for the first page load ("After the page has loaded once, don't allow any more navigation" in packages/desktop/src/webview.rs). It opens http, https and mailto URLs in the system browser. wry calls the handler on WKWebView, WebKitGTK and WebView2, so all three should agree. The fork the fixture pins and dioxus-desktop 0.7.10 have the same code.
  • This differs from Chrome by design, so it isn't a driver bug. The Dioxus driver README now says the page doesn't navigate, and that a form whose action is an external http or https URL opens that URL in the system browser, without the form's data.

Left out

  • The optional iframe item. On Windows, wry doesn't run the navigation handler for frames, so the frame would load the Dioxus app a second time. Its second bridge polling loop could take the driver's scripts. The top-level tests cover the login-form case.

CI

  • The Tauri tests pass on WebKitGTK, WebView2 and WKWebView, and the Dioxus check passes on all three.

Follow-up

Related Issues

Closes #991

Type of Change

  • 📖 Documentation update
  • E2E tests only, plus the README line.

Scope

  • scope:tauri - Tauri service and plugin
  • scope:dioxus - Dioxus service and embedded driver

Testing

  • E2E tests added
  • E2E wasn't run locally. CI runs the Tauri and Dioxus embedded suites.
  • How each test fails with its behaviour reverted, reasoned rather than run:
    • Tauri: if Enter stops submitting, location.search never changes and the wait times out. If a key action throws or waits out the script timeout, its await fails. If the URL changes without a reload, the marker check fails.
    • Dioxus: if Dioxus lets the submit navigate, the wait for a navigation succeeds instead of timing out, and the URL and marker checks fail. If Enter stops submitting, the submit log is empty.

Tauri navigates, so its tests wait for the new page and then restore the one the spec started on. Dioxus desktop blocks navigation once the app has loaded, so its test asserts the submit fires without navigating, and the Dioxus driver README no longer says the page navigates.
@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor
Release Preview — no release

No bump label detected.
Note: Add bump:patch, bump:minor, or bump:major to trigger a release.


Updated automatically by ReleaseKit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

embedded drivers: Enter on a form whose submit isn't cancelled has never run in CI

1 participant