Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the testOptions.animationsDisabled property in Android Gradle plugin do?

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.

like image 453
Philippe A Avatar asked Apr 18 '17 13:04

Philippe A


People also ask

What is Gradle properties in Android Studio?

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.

What is Gradle Android plugin?

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.

Where is Gradle properties in Android Studio?

In the Project window, right click your Project name and choose New > File. The new file name is "gradle. properties".

What is the purpose of the Gradle in Android Studio and at what point can its content be modified?

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.


1 Answers

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

like image 73
JDurstberger Avatar answered Oct 27 '22 04:10

JDurstberger