TestOptions

Options for running tests.

Properties

PropertyDescription
animationsDisabled

Disables animations during instrumented tests you run from the cammand line.

execution

Specifies whether to use on-device test orchestration.

reportDir

Name of the reports directory.

resultsDir

Name of the results directory.

unitTests

Configures unit test options.

Methods

No methods

Script blocks

BlockDescription
unitTests

Configures unit test options.

Property details

boolean animationsDisabled

Disables animations during instrumented tests you run from the cammand line.

If you set this property to true, running instrumented tests with Gradle from the command line executes am instrument with the --no-window-animation flag. By default, this property is set to false.

This property does not affect tests that you run using Android Studio. To learn more about running tests from the command line, see Test from the Command Line.

String execution

Specifies whether to use on-device test orchestration.

If you want to use Android Test Orchestrator, you need to specify "ANDROID_TEST_ORCHESTRATOR", as shown below. By default, this property is set to "HOST", which disables on-device orchestration.

android {
  testOptions {
    execution 'ANDROID_TEST_ORCHESTRATOR'
  }
}

String reportDir

Name of the reports directory.

String resultsDir

Name of the results directory.

UnitTestOptions unitTests

Configures unit test options.

Script block details

unitTests { }

Configures unit test options.

Delegates to:
UnitTestOptions from unitTests