I recently discovered the property testOptions.animationsDisabled in the Android Gradle plugin.
I was hoping it would be helpful to disable the animations on my devices when executing UI tests with Espresso, but it's not, i.e. I still have to disable the animations manually or using one of several options available. Otherwise some UI tests become flaky.
Since the description of this property is rather short, does anyone know how it's meant to be used?
My gradle file is as follows:
apply plugin: 'com.android.application'
android {
testOptions {
animationsDisabled = true
}
}
Thanks.
Android Studio uses Gradle, an advanced build toolkit, to automate and manage the build process, while allowing you to define flexible custom build configurations. Each build configuration can define its own set of code and resources, while reusing the parts common to all versions of your app.
The Android Gradle plugin (AGP) is the official build system for Android applications. It includes support for compiling many different types of sources and linking them together into an application that you can run on a physical Android device or an emulator.
In the Project window, right click your Project name and choose New > File. The new file name is "gradle. properties".
Gradle is another build system that takes the best features from other build systems and combines them into one. It is improved based off of their shortcomings. It is a JVM-based build system. That means you can write your own script in Java, which Android Studio makes use of.
Unfortunately, nothing.
I added a comment a while ago that it is not used in the 2.3.3 plugin.
I hoped something changed with the Android Studio 3.1 and androidGradle 3.1 plugin release but that isn't the case.
I think it is a bit misleading that this flag exists and isn't better documented
Edit:
I have been forwarded this blog post that explains how to set up a test rule that disables animations for you.
https://proandroiddev.com/one-rule-to-disable-them-all-d387da440318
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With