flavioarfaria / KenBurnsView

Android ImageViews animated by Ken Burns Effect

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue when testing with Espresso

OshadhaAK opened this issue · comments

When testing a view which has a KenBurnsView with espresso, it will throw the exception below.

androidx.test.espresso.PerformException: Error performing 'single click - At Coordinates: 238, 638 and precision: 16, 16' on view 'with text: is "Product_05"'. 

Caused by: androidx.test.espresso.AppNotIdleException: Looped for 7184 iterations over 60 SECONDS. The following Idle Conditions failed .

Test case remains looping over and over without either passing or failing.

After setting the KenBurnsView to invisible, test case will be passed.

Issue is KenBurnsView is reloading the page infinitely

This is because the view is constantly animating. The same problem happens with progress bars. There's nothing we can do in the library to fix it, since Espresso just doesn't play well with any type of animation. I would suggest you to pause the animation by calling view.pause() before running your Espresso test.

@flavioarfaria can't the library verify if the system animations are enabled and only play the animation if the system animations are enabled? Like this https://stackoverflow.com/a/42670723