Why android espresso test fails when checking whether textView text ends with expected string (when ellipsized)

前端 未结 3 462
暗喜
暗喜 2021-01-24 08:06

I have an android test checking that external text message is truncated and ends with three dots when applying android:ellipsize=\"end\". I do not know why test fails despite te

3条回答
  •  一向
    一向 (楼主)
    2021-01-24 08:39

    It might be because you're checking for the string "..." instead of the string "…" (the latter being one character instead of three dot characters).

    Double check this by looking at the Espresso output. "Got: AppCompatTextView" ..." has a text= part that tells you exactly what text Espresso finds on the view.

提交回复
热议问题