【发布时间】:2019-02-17 21:55:31
【问题描述】:
我正在我的Android project 中运行基于Espresso 2.2.2 的仪器测试。当我通过 Nexus 5 手机 (Android 6.0.1) 和 Nexus 9 平板电脑 (Android 7.1.1) 等不同设备本地运行所有测试时,所有测试成功以下命令:
./gradlew testDebug connectedCheck --stacktrace -PdisablePreDex
一旦我使用这个configuration 在 Travis CI 上运行相同的任务,那么其中两个测试失败并出现令人困惑的错误消息:
CityInfoFragmentTest > renderCityInfoWithStandardZone[test(AVD) - 4.3.1] FAILED
android.support.test.espresso.base.DefaultFailureHandler$AssertionFailedWithCauseError:
'with text: is
"Since May 1, 2014 only vehicles with a green sticker are allowed to drive into the low emission zone."
' doesn't match the selected view.
Expected: with text: is
"Since May 1, 2014 only vehicles with a green sticker are allowed to drive into the low emission zone."
如您所见,实际文本与预期文本匹配!?!
我没有使用 Espresso 3.0.2,因为有一个 bug which prevents running tests on certain devices。
【问题讨论】:
标签: android travis-ci android-espresso android-testing