如何用文字颜色进行意式浓缩咖啡测试?当前使用hasTextColor():
onView(withId(R.id.editText)).check(matches(hasTextColor(Color.BLACK)));
但是会发生错误:
android.content.res.Resources $ NotFoundException:资源ID#0xff000000,位于android.content.res.ResourcesImpl.getValue(ResourcesImpl.java:195)
...
细节:
<EditText
android:id="@+id/editText"
android:textColor="#ff000000"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="48dp"/>
您需要检查资源中定义的颜色,例如 hasTextColor(R.color.red)
它也写在您提供的文档链接中: colorResId : int
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句