-
-
Notifications
You must be signed in to change notification settings - Fork 684
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
Latest main branch breaks testbed test_app.py::test_current_window
test on macOS
#2860
Comments
Huh... so it is. It looks like this is a side effect of the rework of Document-based apps; by adding document definitions to the testbed app (so that we can test document features), that has triggered the "file open" logic on a new app. That shouldn't be happening, because the app isn't a full "document-based" app - so something definitely needs to be fixed here. |
Taking a quick look at it, the problem is arising due to the addition of toga/cocoa/src/toga_cocoa/app.py Lines 50 to 57 in 8bec404
As mentioned in the docs: https://developer.apple.com/documentation/appkit/nsapplicationdelegate/1428444-applicationshouldopenuntitledfil#discussion
Since But I haven't looked deeply into it and there might be more to it. |
@proneon267 I think your analysis is completely correct - the error is that the implementation of This won't be affecting other platforms, because |
It seems that when Hence, we cannot check if This must be due to timing of the delegate event being triggered and the calling of the startup() method, i.e., |
Describe the bug
With the latest main branch of toga, at the beginning of every test of testbed, an "Open File Dialog" is being shown, which has input focus. Consequently the testbed
test_app.py::test_current_window
test fails as the input focus is on the dialog instead of on the main window.Steps to reproduce
Notice a "Open File dialog" being shown from the start of the test:
Get Error Message:
Expected behavior
The "Open File Dialog" should not be shown at the start of the test.
Screenshots
No response
Environment
Logs
Additional context
The bugs seems to have been arisen out of the following addition of the document_types to the testbed:
toga/testbed/src/testbed/app.py
Lines 225 to 229 in 8bec404
As without specifying the document_types, the testbed
test_app.py::test_current_window
test passes and no "Open File Dialog" is shown at the beginning of the test.This problem is also arising on the linux-wayland testbed, as evident by the CI failures of input focus related widget tests.
The text was updated successfully, but these errors were encountered: