I am trying out Android P preview on Pixel device, and currently experiencing an issue with instrumentation tests written with UiAutomator framework.
Whenever a button click is simulated with UiAutomator by following code:
onView(withId(R.id.button_activity_login)).perform(click())
I am encountering an AlertDialog with message
Detected problems with API compatibility (visit g.co/dev/appcompat for more info)
which leads to this link:
This breaks UiAutomator tests since my tests currently do not consider additional AlertDialog between each action.
This only happens with UiAutomator's button click, not with Espresso's. I believe that UiAutomator might use some reflections under the hood in order to achieve cross-app testing functionality (not knowing the UI component's texts or ids beforehand), whereas Espresso takes care of everything inside the app being tested.
This is somewhat weird since UiAutomator is a testing framework Google itself suggests in their developer sites (https://developer.android.com/training/testing/ui-automator.html#ui-automator-apis). Does anybody have experienced or solved the following issue?
Aucun commentaire:
Enregistrer un commentaire