Question

I have used UiAutomator in the past. It will not do what I need now, so I am using Espresso. One thing I loved about UiAutomator is the ability to create a UiWatcher. I have many dialogs that appear at random times.

So my question is how could I create a "watcher" that will handle the appropriate dialog if appeared? I have thought about creating a loop that checks for it, but will that be too CPU expensive?

Was it helpful?

Solution

There is no such functionality in Espresso. Generally, conditional logic in tests is undesirable - you should control the environment (device) on which your tests execute so you do not get unexpected behavior.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top