Android Espresso IntentsMatcher适用于新设备,但不算旧
我有一个Espresso单元测试,似乎在较新的设备上工作,但在API 17设备上失败。 这是测试:
Intents.init() [... more setup] onView(withId(R.id.username)) .perform(typeText("username")) .perform(closeSoftKeyboard()) onView(withId(android.R.id.button1)).perform((click())) // This part fails intended(hasComponent(AcceptedActivity::class.java.name))
错误是:
android.support.test.espresso.base.DefaultFailureHandler$AssertionFailedWithCauseError: Wanted to match 1 intents. Actually matched 0 intents.
我已经试过在intended
被调用之前睡了1000毫秒的线程,但这似乎没有帮助。
任何想法,为什么它成功的一些设备,但不是旧的?
- 使用flatMap的Rx Java Retrofit只运行一次
- SimpleXML在Thread.getContextClassLoader()返回的类加载器可能失败之后抛出ClassNotFoundException
- 当选择的项目视图为空时,Kotlin在Android上崩溃
- 更新Android Studio后无法打开项目
- 为什么不在Kotlin的Android 4.x下运行应用程序?
- 没有活跃的管理员拥有… – 在Android中锁定屏幕
- 使用Kotlin Anko拍摄照片并显示结果的最佳方法是什么?
- Android的MapView在片段
- Firebase存储的OnSuccessListener回调没有调用
- java.lang.NoClassDefFoundError:com.example.api.retrofit.AuthenticationInterceptor $ intercept $ 1
- 如何创建像anko – DSL语法Kotlin嵌套函数回调