Android espresso测试在本地传递,但在Firebase测试实验室失败

And*_*ndy 16 automation android firebase android-espresso firebase-test-lab

我有android espresso测试的问题.测试在本地传递但在FTL上失败.这是一个简单的测试

onView(allOf(withId(R.id.text_supercategory_name), withText("Air conditioners"))). check(matches(withText("Air conditioners")));

这个测试通过本地.在FTL我有错误:

android.support.test.espresso.NoMatchingViewException: No views in hierarchy found matching: (with id: blablabla:id/text_product_verdict and with text: is "Air conditioners")

我不明白,我看到我的测试中没有使用的id/text_product_verdictID ......以及来自其他活动的ID ...测试活动是正确的

@Rule public ActivityTestRule<HomeActivity> mActivityTestRule = new ActivityTestRule<>(HomeActivity.class);

我查看了FTL上失败测试的视频,并在FTL上看到了很多关于模拟器img的通知

我认为问题是来自Google环聊的粘性通知,并尝试使用--no-auto-google-login旗帜运行我的测试.但是有相同的结果.随着onView(withText("Air conditioners")).check(matches(isDisplayed()));测试通过对FTL.

有人可以帮忙解决问题吗?

All*_*len 1

这也发生在我身上。Firebase 测试实验室似乎无法识别某些设备中的IDwithId(R.id.text_supercategory_name)。我们可以使用res-name来代替。

检查日志中的视图层次结构并获取其中的 res-nameonView(withResourceName("res-name")).perform(click());

// change res-name to buttonPanel, button3, button2, or button1
+---->ScrollView{id=16908757, res-name=buttonPanel, visibility=VISIBLE, width=1008, height=217, has-focus=false, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=true, is-layout-requested=false, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=1507.0, child-count=1}
|
+----->ButtonBarLayout{id=-1, visibility=VISIBLE, width=1008, height=217, has-focus=false, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=4}
|
+------>AppCompatButton{id=16908315, res-name=button3, visibility=GONE, width=0, height=0, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=true, is-enabled=true, is-focused=false, is-focusable=true, is-layout-requested=true, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, text=, input-type=0, ime-target=false, has-links=false}
|
+------>Space{id=16909293, res-name=spacer, visibility=INVISIBLE, width=429, height=0, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=42.0, y=203.0}
|
+------>AppCompatButton{id=16908314, res-name=button2, visibility=VISIBLE, width=271, height=189, has-focus=false, has-focusable=true, has-window-focus=true, is-clickable=true, is-enabled=true, is-focused=false, is-focusable=true, is-layout-requested=false, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=471.0, y=14.0, text=Cancel, input-type=0, ime-target=false, has-links=false}
|
+------>AppCompatButton{id=16908313, res-name=button1, visibility=VISIBLE, width=224, height=189, has-focus=false, has-focusable=true, has-window-focus=true, is-clickable=true, is-enabled=true, is-focused=false, is-focusable=true, is-layout-requested=false, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=742.0, y=14.0, text=OK, input-type=0, ime-target=false, has-links=false}
Run Code Online (Sandbox Code Playgroud)