dbaelz
08/11/2021, 1:02 PMonNodeWithText
) can't find the text and I assume it's because it's in a different window and the rule can't access it? Did look into the DesktopComposeTestRule
and saw that it creates a window for the test and so on, but can't figure out a way to test the visibility of the dialog texts.Igor Demin
08/11/2021, 1:41 PMUndecoratedWindowAlertDialogProvider
?
If yes, then this is definitely not supported at the moment, as we create a real native window, which is not visible to DesktopComposeTestRule
If not, then I am not sure, as we create a layer of the window, which is visible to DesktopComposeTestRule
Actually, we haven't implemented DesktopComposeTestRule
very well at the moment, and most certainly it doesn't work well with any popups/dialogs.
We plan to fix multiple issues before 1.0.0. But not sure if we will properly support dialog's/popup's in tests.
There are some ideas, but they are only ideas, there is no a solid plan yet. If you want to track the issue, you can create it here.
Current workarounds:
• test content of AlertDialog
separately
• mock AlertDialog
in tests by something else (Box
for example)dbaelz
08/12/2021, 2:02 PMUndecoratedWindowAlertDialogProvider
for the AlertDialog. The workarounds sound good and I give it a try. Based on that I might use set the dialog provider with a param in the composable and use PopupAlertDialogProvider for testing.
For the Dialog (Window Dialog) extracting the dialog content seems to be the best way to test it. Will play around with it a little and might create an issue.dbaelz
08/12/2021, 2:02 PM