linkedin / test-butler

Reliable Android Testing, at your service
Apache License 2.0
1.05k stars 92 forks source link

Set cursor drawable to empty in tests #107

Closed chao2zhang closed 3 years ago

chao2zhang commented 3 years ago

Cursor is part of animating parts on a TextView when executing tests. I am wondering if this is TestButlet's scope to disable the cursor (or set it to white by default) so that we can get reliable screenshots.

In addition, the EdgeEffect of a RecyclerView and the scroll bar of a View can be discussed altogether in this thread.

drewhannay commented 3 years ago

It might be okay to add this if we can do it in a way that's disabled by default, since I'm guessing many use cases still want to see the cursor and EdgeEffect. Do you have an idea of what the implementation would look like?

chao2zhang commented 3 years ago

The solution turns out to be overriding the theme attributes in test code. And the purpose of this is visual regression tests, not necessarily the usual assertion tests code that test-butler.

I am now leaning towards not building this solution in test-butler, please let me know otherwise.

drewhannay commented 3 years ago

Sounds good to me, thanks for investigating.