Composer has ComposeTestRule and AndroidComposeTestRule to test Composer.
https://developer.android.com/jetpack/compose/testing
As Appium, we’d like to inject them to interact with composer components reliably. So, I took a look at their code a bit to understand the codebase.
According to https://developer.android.com/jetpack/compose/testing#espresso-interop this section, the composer rule can use with Espresso. Thus, I guessed Appium-Espresso driver also could access composer components over the rule.
The code had createAndroidComposeRule. The rule got ActivityScenarioRule. I could see some methods such as get element nodes, the root or actions. One interesting thing was AndroidTestOwner. Was this main controller for Android Test? (Just a guess). It seemed ComposeRootRegistry worked to get composer components via composeRootRegistry.getRegisteredComposeRoots() in getRoots in AndroidTestOwner.
As another way to work with Android composer via Appium, I assume Appium can interact with elements via accessibility features. Composer has below resource/accessibility features. contentDescription and resource id are typical ways to interact elements via UIA2. So, it would be great if Appium can work with composer via them at least…
https://developer.android.com/jetpack/compose/resources
https://developer.android.com/jetpack/compose/accessibility
Update:
1 Comment