【发布时间】:2019-11-08 08:38:13
【问题描述】:
一夜之间我的 ui 测试突然停止工作:
在咖啡师clickOn(R.id.myView) 中排队抛出:
com.schibsted.spain.barista.internal.failurehandler.BaristaException: Could not perform action single click on view with id: [...]
[...]
Caused by: androidx.test.espresso.NoMatchingViewException: No views in hierarchy found matching: (is displayed on the screen to the user and with id: [...]
在 Espresso 中排队 onView(withId(R.id.myView)).perform(scrollTo(), click()) 抛出:
androidx.test.espresso.PerformException: Error performing 'single click - At Coordinates: 53, 1723 and precision: 16, 16' on view 'Animations or transitions are enabled on the target device.
[...]
Caused by: java.util.NoSuchElementException: List is empty.
我不明白为什么会这样。我可以在测试期间看到屏幕上的视图,并且 espresso 给了我一些坐标。
编辑:
因为它是一个 TextView 我也试过 Baristas clickOn(context.getString(R.string.myText)) 但它抛出:
com.schibsted.spain.barista.internal.failurehandler.BaristaException: Could not perform action single click on view with text: is [...]
[...]
Caused by: androidx.test.espresso.NoMatchingViewException: No views in hierarchy found matching: (is displayed on the screen to the user and with text: is [...]
<TextView
android:id="@+id/myView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/myText"/>
【问题讨论】:
-
您可以将窗口/过渡动画比例设置为关闭再试一次吗?从这个SO post?
-
我这样做了,但它并没有改变任何东西。此片段中没有布局更改或动画。
标签: android android-espresso android-testing barista