Step 4: Configuring test types - AWS Device Farm

Step 4: Configuring test types

By default, the AWS Device Farm Gradle plugin runs the Working with instrumentation for Android and AWS Device Farm test. If you want to run your own tests or specify additional parameters, you can choose to configure a test type. This topic provides information about each available test type and what you need to do in Android Studio to configure it for use. For more information about the available test types in Device Farm, see Working with test types in AWS Device Farm.

If you haven't done so already, complete steps 1 – 3 before configuring test types.

Note

If you are using device slots, the device slots feature is disabled by default.

Appium

Device Farm provides support for Appium Java JUnit and TestNG for Android.

You can choose useTestNG() or useJUnit(). JUnit is the default and does not need to be explicitly specified.

appium { tests file("path to zip file") // required useTestNG() // or useJUnit() }

Built-in: fuzz

Device Farm provides a built-in fuzz test type, which randomly sends user interface events to devices and then reports the results.

fuzz { eventThrottle 50 // optional default eventCount 6000 // optional default randomizerSeed 1234 // optional default blank }

For more information, see Built-in: fuzz (Android and iOS).

Instrumentation

Device Farm provides support for instrumentation (JUnit, Espresso, Robotium, or any instrumentation-based tests) for Android. For more information, see Working with instrumentation for Android and AWS Device Farm.

When running an instrumentation test in Gradle, Device Farm uses the .apk file generated from your androidTest directory as the source of your tests.

instrumentation { filter "test filter per developer docs" // optional }