0
我使用espresso测试应用程序。这个应用程序有2个ListViews,特浓咖啡onData函数找到两个ListViews,但它们有不同的ID。espresso onData是否与层次结构中的多个视图匹配?
代码:
onData(withId(R.id.order_jijia_listview)).perform(ViewActions.click());
结果:
ListView{id=2131493579, res-name=order_jijia_listview, visibility=VISIBLE, width=768,
height=659, 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=0.0, y=345.0, child-count=7} ****MATCHES****
ListView{id=2131493586, res-name=order_jijia_pop_listview, visibility=VISIBLE, 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=false,
is-layout-requested=true, is-selected=false, root-is-layout-requested=false,
has-input-connection=false, x=0.0, y=0.0, child-count=0}