For testing UI you should have all animations turned off. Animations are tested manually (visually) by person.
Basically animations are no value to business logic and the flow in the meaning of application purpose. They are great value to after effect for the user and they make application look soft.
Even when you test using Espresso, it let’s you know that device must have animations off when Android Tests are running (documentation as well https://google.github.io/android-testing-support-library/docs/espresso/setup/index.html#setup-your-test-environment).