I'm struggling to get Robotium to work with the Android gradle platform, and I cannot find a way to run the test using the gradle CLI. I placed robotium.jar "robotium-solo-5.4.1.jar" in the libs folder, added as a library. In the src folder, I created another package androidTest-> java-> for a test source with the same name as the name of the application package-> Test.java "java" (inside "androidTest") - green.
UI: as usual, using the menu Android Studio Run - works.
Console
: in the terminal, enter the following command: gradlew connectedAndroidTest = does not work. I also tried the "gradlew test", the test results are generated in the build / test-report file, but they show that no tests were found.
I want to run a Robotium test with a gradle CLI without connecting a device because I want to run tests in an Android emulator in CircleCI.
Is there a problem in the build.gradle / test file or is there something I can't see?
I am very grateful for any help!
***** This is my build.gradle file
apply plugin: 'com.android.application' apply plugin: 'io.fabric' android { compileSdkVersion 22 buildToolsVersion "22.0.1" dexOptions { // jumboMode true javaMaxHeapSize "2g" } defaultConfig { applicationId 'net.example' minSdkVersion 14 targetSdkVersion 22 versionName '2.8.1' versionCode 2801 multiDexEnabled true } buildTypes { debug{ debuggable true jniDebuggable true } release { debuggable false jniDebuggable false minifyEnabled true proguardFiles 'proguard-coda.txt', 'proguard-rules.pro' } } productFlavors { } packagingOptions { exclude 'META-INF/LICENSE.txt' exclude 'META-INF/LICENSE' exclude 'META-INF/NOTICE' } lintOptions { disable 'MissingTranslation' } sourceSets { androidTest { java.srcDirs = ['src/androidTest/java'] } } } dependencies { // Included library modules ... // My regular dependencies ... compile fileTree(include: ['*.jar'], dir: 'libs') // Test dependencies androidTestCompile 'com.jayway.android.robotium:robotium-solo:5.4.1' androidTestCompile fileTree(dir: 'libs', include: 'robotium-solo-5.4.1.jar') }
***** Robotium test file in the folder: app-> src-> androidTest-> java-> package name-> Test.java
package net.example; import com.robotium.solo.*; import android.test.ActivityInstrumentationTestCase2; import android.view.View; import java.util.ArrayList; @SuppressWarnings("rawtypes") public class Test extends ActivityInstrumentationTestCase2 { private Solo solo;
user4974298
source share