There are two kinds of Android popovers and toast: an activity-based window popover; A popover based not on the activity Window but on other Windows.
The first actiivity-based popover does not need to be matched using inRoot by default.
The second type needs to be matched using inRoot alone:
(Print window type, usually there are two types when there are popovers and interfaces)
There is a problem here, if the toast is a flash, if it is not executed at the correct time, this code may report an error, right? (Root has a timeout waiting mechanism. For a period of time, matchesSafely does not match the window type, that is, it returns true and repeats the matching logic.)
Written in full:
One more question, if the toast is:
Click “Welcome” — > then click “Login successful”.
This code executes logic:
> < span style = “box-sizing: border-box; color: RGB (51, 51, 51);
To solve this problem, I wrote a timeout waiting Utils” TimeoutEspressoUtils”. The utility class is used to loop and match my condition for a specified time until the timeout ends. (Espresso timeout tool, because it is used in Tencent’s internal project, it is not convenient to disclose, you can talk to me privately about the implementation ideas)
Tool class writing: