Android P preview aborts UiAutomator tests with API compatibility error

I am trying to use the Android P preview on a Pixel device and am currently experiencing a problem with instrumental tests written using the UiAutomator framework.

Whenever a button click is modeled using UiAutomator, following the code:

onView(withId(R.id.button_activity_login)).perform(click())

I meet AlertDialog with a message

Detected problems with API compatibility (visit g.co/dev/appcompat for more info)

which leads to this link:

https://developer.android.com/preview/restrictions-non-sdk-interfaces.html#differentiating_between_sdk_and_non-sdk_interfaces

This violates the UiAutomator tests, as my tests currently do not account for the extra AlertDialog between each action.

UiAutomator, Espresso. , UiAutomator , ( ), Espresso , .

, UiAutomator - , Google (https://developer.android.com/training/testing/ui-automator.html#ui-automator-apis). - ?

+4

Source: https://habr.com/ru/post/1695392/


All Articles