4
我想測試我的AWS服務器場中的應用程序,使用AWS設備農場咖啡和JUnit4
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'
樣品測試:
@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");
}
}
,但它只是試驗拆卸和安裝套件的測試...看起來它不認識測試...
另一件事是,我正在創建apk和測試apk與gradlew。
#./gradlew assembleMockAndroidTest
,我上傳app-mock-androidTest-unaligned.apk
和app-mock-unaligned.apk
文件。
我的過程中出了什麼問題?
案例:https://forums.aws.amazon.com/thread.jspa?messageID=647198򞀞
答案好像有別的東西,需要從命名約定分開進行。讓我知道是否還有其他問題需要解決。 – Daggerhunt
但是,解決了這個問題... – Caipivara