-
Notifications
You must be signed in to change notification settings - Fork 672
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handling of native dialogs inconsistent with handling in Firefox #6815
Comments
Browsers and standards... Digging further into this, the example in MDN is a bit weird, since setting the But the comment in MDN's example is correct about Chrome, which has an outstanding bug that requires the This just for references or curiosity. It remains that Firefox shows the dialog irrespective of the order of calling |
Hello @dfn-certling , Thank you for pointing out this issue and sharing the code example. |
This issue has been automatically marked as stale because it has not had any activity for a long period. It will be closed and archived if no further activity occurs. However, we may return to this issue in the future. If it still affects you or you have any additional information regarding it, please leave a comment and we will keep it open. |
The issue is still present as originally described with TestCafe 2.2.0, Node v16.18.0 and Firefox 108.0.2. |
fixed in DevExpress/testcafe-hammerhead#2980 |
What is your Scenario?
I have a form with a
beforeunload
handler attached on changes. I want to write a test that verifies the conditions of the dialog being shown.What is the Current behavior?
The dialog appears when opened in the browser directly, but it is not triggered when exercised in a test.
What is the Expected behavior?
The dialog should be triggered in the test.
What is your public website URL? (or attach your complete example)
The behavior can be reproduced with the following example page
This is an adaption of the example used in #5994 (comment). According to the MDN documentation on onbeforeunload strings returned or set for
returnValue
are not presented to the user anymore. The example present in the documentation gives the abovee.preventDefault()
ande.returnValue
commands to display the dialog, which works in Firefox directly.What is your TestCafe test code?
Your complete configuration file
No further configuration
Your complete test report
Screenshots
No response
Steps to Reproduce
Curiously some changes to the example page do trigger it. One way is to set a nonempty string for the
returnValue
, another one is to switch the order of callingpreventDefault
and settingreturnValue
. None of these changes change the result when testing in the browser directly, and they are not required by my reading of the MDN documentation. This only happens in Firefox, Brave for example (Chromium based) triggers the dialog also in the test all the time.TestCafe version
1.18.1
Node.js version
v16.13.1
Command-line arguments
testcafe firefox test-handler.js
Browser name(s) and version(s)
Firefox 95.0
Platform(s) and version(s)
openSUSE Tumbleweed
Other
No response
The text was updated successfully, but these errors were encountered: