Hi guys, how can I disable animations when running...
# android
Hi guys, how can I disable animations when running espresso tests? Have done everything I found on SO, everywhere. Yet animations done by : view.animate()... keep disabling my tests to continue running. Please some light here. Tried DisableAnimation rules, also gradle configurations, nothing works, few animations are disabled, OS level like transitions, but view animations are not. Kind regards.
If you run the animations manually, you need to scale the duration based on system animation duration scale
Copy code
val Context.animationDurationScale: Float
    get() = Settings.Global.getFloat(this.contentResolver, Settings.Global.ANIMATOR_DURATION_SCALE, 1f)
At least that’s what we’ve been doing
For some animations, disabling them are not possible, like material bottom sheet 😕
thanks, yes, already noticed and there are some animations we have to disable with flags for the espresso builds 😞