mardi 29 septembre 2015

AWS device farm with Espresso and JUnit4

I want to test my app in AWS farm, using

androidTestCompile 'com.android.support.test:runner:0.4'
androidTestCompile 'com.android.support.test:rules:0.4'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.1'
androidTestCompile 'com.android.support.test.espresso:espresso-intents:2.2.1'
androidTestCompile('com.android.support.test.espresso:espresso-contrib:2.2.1') {
    exclude group: 'com.android.support', module: 'appcompat'
    exclude group: 'com.android.support', module: 'support-v4'
    exclude module: 'recyclerview-v7'
}
androidTestCompile 'junit:junit:4.12'
androidTestCompile 'com.squareup.retrofit:retrofit-mock:1.9.0'
androidTestCompile 'com.squareup.assertj:assertj-android:1.1.0'
androidTestCompile 'com.squareup.spoon:spoon-client:1.2.0'

Sample test:

@RunWith(AndroidJUnit4.class) and run with AndroidJUnitRunner, I have my tests starting like:

@RunWith(AndroidJUnit4.class)
@LargeTest
public class EstimationActivityTests {

@Rule
public ActivityTestRule<LoginActivity> mActivityRule = new ActivityTestRule(LoginActivity.class);

@Before
public void setup() {
}

@Test
public void showsRightDataOnCreate() {
org.junit.Assert.assertEquals("asd", "asd");
}
}

But it just test teardown and setup suite tests... looks like it dont recognize the tests...

Another thing is that I´m creating the apk and test apk with gradlew.

#./gradlew assembleMockAndroidTest

and I upload the files in app-mock-androidTest-unaligned.apk and app-mock-unaligned.apk.

What´s wrong in my process?

Case: http://ift.tt/1FFtJ9q

Aucun commentaire:

Enregistrer un commentaire