I also love compose desktop, especially since it c...
# compose-desktop
l
I also love compose desktop, especially since it can integrate with Swing components. However, it looks like the testing facilities are currently limited to unit tests of composables, i.e. using composeTestRule. Does anyone know if there are plans or a release date for testing facilities similar to Espresso that would allow a hybrid Swing/Compose application to be tested? That is, finding/interacting/reading/asserting with a semantics node if the composables are in a ComposePanel or ComposeWindow. This sort of facility is needed for high-level tests like Cucumber where the step definitions have to provide interactions and assertions for the application as a whole.
a
If your testing framework uses accessibility to interact with the app, then it should already be possible (although limited, as accessibility isn’t perfect). But no, there’s currently no plan for a dedicated testing API that combines swing and compose.
l
Thanks for your response. Can you point me to an example of using accessibility for testing?
a
Not really. I only know that some system-level testing frameworks do that.
l
OK, do know of a specific system-level framework that I can look at?
Hi Alex. The good news is the a colleague of mine, @Tim Lavers has found a way to use the Accessibility API for non-unit tests, i.e. where you don't have the facilities of ComposeTestRule. This works really well for both a pure desktop compose application, and also for a hybrid Swing/compose application. So we are now able to write cucumber tests as required.
So your clue regarding accessibility was, in fact, spot on.
🔥 2