当将com.google.android.gms:play-services-auth:11.6.0和com.android.support.test.espresso:espresso-core:3.0.1作为依赖于安卓库模块时,我看到了一些兼容性问题
我得到了一个错误:
Execution failed for task ':mylibrary:transformResourcesWithMergeJavaResForDebugAndroidTest'.
More than one file was found with OS independent path
我有一个安卓测试,检查外部文本消息是否被截断,并在应用android:ellipsize="end“时以三个点结尾。我不知道为什么测试失败,尽管在一个活动中显示的文本是正确格式化的。
@Test
fun when_errorMessage_is_very_long_then_text_of_errorMessageTextView_ends_with_dots() {
//given
val errorMessage = """
Very long error, Very long error, Very lo
我正在试着用Espresso测试我的应用程序。 我有一个问题:在一个用例中,我需要打开一个PDF来读取“用户条件”,并且我不能用Espresso.pressBack()从这一点返回,我总是有下面的错误: android.support.test.espresso.NoActivityResumedException: No activities in stage RESUMED. Did you t to launch the activity. (test.getActivity() or similar)?
at dalvik.system.VMStack.getThreadStack
我在takeScreenShot()中得到了错误,并且在执行命令fastlane Screengrab时也给出了语言配置的错误。
下面是我的测试执行代码
/**
* Instrumentation test, which will execute on an Android device.
*
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@ClassRule
public static final LocaleTestRule localeTestRule = new L
我正在试用新的Android测试库Espresso。当我尝试的时候:
onView(withId(R.id.gettingStarted))
测试运行良好。但当我尝试时:
onView(withId(R.id.gettingStarted)).check(matches(isDisplayed()));
我得到了一个.NoMatchingViewException: No views in hierarchy found matching: with id: is <2131296645>
以前有没有人见过这样的东西?我最初的反应是这只是一个bug,因为Espresso只在1.0版
我在试着用Espresso。但是我有这个错误,如果我遗漏了一些代码,我就没有错误。
任何想法都将受到高度赞赏。
错误日志:
java.lang.NullPointerException: No instrumentation registered. Must run under a registering instrumentation.
at com.google.android.apps.common.testing.testrunner.util.Checks.checkNotNull(Checks.java:28)
at com.google.android.apps.
我想简化一个意图,要求系统在用户单击按钮后在指定的url上打开web浏览器。
Intents.init()
val expectedIntent = allOf(hasAction(Intent.ACTION_VIEW), hasData(url))
intending(expectedIntent).respondWith(ActivityResult(0, null))
// here text view with link is clicked which will
// launch browser to show web site
onView(withId(id)).perfo
如果我设置了无效的密码--用文本“无效数据!”显示password.setError(getResources().getString(R.string.incorrect_data));,我需要用Espresso测试它,我写到:
onView(withText(R.string.incorrect_data)).check(matches(isDisplayed()));
但这是错误的,我有:
android.support.test.espresso.NoMatchingViewException: No views in hierarchy found matching: with st
我的应用程序中有三个活动
登录活动
主要活动
细节活动
我想使用espresso测试一系列事件:单击登录活动上的登录按钮,这将打开主活动,然后单击主活动中的列表项,这将打开详细活动,然后单击详细活动中的另一个按钮。我首先创建了这个简单的测试,以获得对listview的引用:
public class LoginActivityTest extends ActivityInstrumentationTestCase2<LoginActivity> {
public LoginActivityTest() {
super(LoginActi
我正在学习Android的TDD,使用这个demo: https://github.com/NileshJarad/TDD_Demo 我可以运行所有的单元测试和Mockito测试,但是"activityTests“失败了,错误如下: error: package android.support.test.rule does not exist
error: package android.support.test.espresso does not exist
error: package android.support.test.espresso.action does not