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.
w
wasyl
12/16/2019, 1:27 PM
If you run the animations manually, you need to scale the duration based on system animation duration scale
wasyl
12/16/2019, 1:28 PM
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
wasyl
12/16/2019, 1:28 PM
For some animations, disabling them are not possible, like material bottom sheet 😕
d
dave
02/12/2020, 11:26 AM
thanks, yes, already noticed and there are some animations we have to disable with flags for the espresso builds 😞