Repository navigation
test(tauri,dioxus): press Enter on a form whose submit isn't cancelled - #1009
Open
goosewobbler wants to merge 4 commits into
Open
goosewobbler wants to merge 4 commits into
goosewobbler wants to merge 4 commits into
Conversation
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.
Contributor
Release Preview — no release
Updated automatically by ReleaseKit |
…cratch Links the getUrl workaround to #1012 and separates the README's two Dioxus submit cases.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)addValue('x' + Key.Enter)and one forbrowser.keys(Key.Enter). Each checks that the key action resolves, waits untillocation.searchis the form's query, then checks that a marker global set before the submit is gone, so the page really reloaded, as in Chrome.getUrl(), because the driver'sexecutecan lose its result when the page navigates (tauri: an execute script that navigates waits out the script timeout #1012).afterEachgoes back to the URL the spec started on withbrowser.url()and waits for the page to load.describenext to the other Enter tests. Mocha runs a nested suite after the suite's own tests, so they run last in the spec.location.replace(location.pathname). On macOS and Linux the URL istauri://localhost, whose path is empty, so that would reload?q=x.Dioxus (
element-events.embedded.spec.ts)addValueand in key actions, firessubmiteach time and both actions resolve. Then a one-second wait for a navigation times out,location.searchstays''and the marker stays.dioxus://orhttp(s)://dioxus.URL only for the first page load ("After the page has loaded once, don't allow any more navigation" inpackages/desktop/src/webview.rs). It openshttp,httpsandmailtoURLs 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.actionis an externalhttporhttpsURL opens that URL in the system browser, without the form's data.Left out
CI
Follow-up
executewaits out the script timeout when the script navigates. Once it's fixed, these tests can wait withexecuteagain.Related Issues
Closes #991
Type of Change
Scope
scope:tauri- Tauri service and pluginscope:dioxus- Dioxus service and embedded driverTesting
location.searchnever changes and the wait times out. If a key action throws or waits out the script timeout, itsawaitfails. If the URL changes without a reload, the marker check fails.submitlog is empty.