如何使用文字颜色进行浓缩咖啡测试? 目前使用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"/>
答案 0 :(得分:2)
您需要检查资源中定义的颜色,例如hasTextColor(R.color.red)
它也写在您提供的文档链接中:
colorResId : int