Reputation: 61
I would like to run Android UIAutomator Tests with AWS Device Farm. The Tests needs to be uploaded as a separate JAR to AWS. In Android Studio (1.4) UIAutomator Tests are part of the app project itself, so no dedicated JAR is generated.
How can I generate a JAR, that just contains the UIAutomator Tests and meets the requirements of AWS Device Farm?
Upvotes: 4
Views: 788
Reputation: 3374
You'll still be able to execute these tests using AWS Device Farm without converting them to a JAR.
On March 12, 2015, Google announced uiautomator 2.0. Without going into too much detail, the significant change made in this new version is that these tests are based on Android instrumentation (generated as APK files) instead of the previously used system of uiautomator 1.0 (generated as JAR files).
I would have to examine the gradle/build configuration further, but my guess is that you're using the new Android testing libraries and thus, using uiautomator 2.0. When you build a project such as this, it will generate two APK files, one for your application and another for your instrumentation tests.
When using AWS Device Farm, you'll want to take these two APK files and upload them using the INSTRUMENTATION test type. This test type works for all Instrumentation based frameworks/tools such as Espresso, uiautomator 2.0, and Robotium. The UIAUTOMATOR test type is specifically for older uiautomator 1.0 projects that still build and use JAR files for their test packages.
Upvotes: 2