Android 测试在我的项目中以错误结束
我的测试班: @RunWith(AndroidJUnit4.class) @最大的 公共类LoginActivityTest4{Android 测试在我的项目中以错误结束,android,unit-testing,android-studio,Android,Unit Testing,Android Studio,我的测试班: @RunWith(AndroidJUnit4.class) @最大的 公共类LoginActivityTest4{ @Rule public ActivityTestRule<LoginActivity> mActivityRule = new ActivityTestRule(LoginActivity.class); @Test public void testContainsIntialViews() { onView(withId(R
@Rule
public ActivityTestRule<LoginActivity> mActivityRule =
new ActivityTestRule(LoginActivity.class);
@Test
public void testContainsIntialViews() {
onView(withId(R.id.Mot_de_passe)).check(matches(isDisplayed()));
onView(withId(R.id.Identifiant)).check(matches(isDisplayed()));
onView(withId(R.id.button_connexion)).check(matches(isClickable()));
}
}
这是我第一次在android下进行测试,所以有人想解释我有什么邪恶或者我忘记了什么,请帮帮我。你在使用任何第三方插件吗?在我的例子中,我使用的是
android aspectjx
,出于模糊的原因,它利用了我的测试运行。从build.gradle文件中删除下面的行有帮助:
apply plugin: 'android-aspectjx'
我建议您检查是否有任何第三方插件可能会影响您的问题,并逐个删除它们,看看其中是否有一个是罪魁祸首
apply plugin: 'android-aspectjx'