gpt4 book ai didi

android-espresso - 安卓, Espresso : How check if tag value contains some string?

转载 作者:行者123 更新时间:2023-12-04 07:24:44 28 4
gpt4 key购买 nike

我想测试是否显示 ID 为 imageViewTour 且标签包含 some_text 的 imageView。

我的测试:

onView(allOf(withId(R.id.imageViewTour), withTagValue(containsString("some_text")))).check(matches(isDisplayed()));

但是我得到了编译错误:

withTagValue (org.hamcrest.Matchers<java.lang.Object) in ViewMatchers cannot be applied to (org.hamcrest.Matcer<java.lang<String>)

最佳答案

使用

 onView(allOf(withId(R.id.imageViewTour), withTagValue(is((Object) "some_text")))).check(matches(isDisplayed()));

关于android-espresso - 安卓, Espresso : How check if tag value contains some string?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42596716/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com