I have an AutoCompleteTextView in my Android Activity
In my espresso test, I want to check if the popup with the proposals is opened or closed.
How can I do that?
I have tried many ideas, including:
onData(anything()).inRoot(RootMatchers.isPlatformPopup()).check(doesNotExist());
onData(anything()).inRoot(RootMatchers.isPlatformPopup()).check(matches(isDisplayed()));
onData(anything()).atPosition(0).inRoot(RootMatchers.isPlatformPopup()).check(matches(isDisplayed()));
In these particular cases, the test just fails or goes to an infinite loop
Example:
In my Adapter, I have 2 values: "abc" and "def"
- when I enter "d", the popup shall open with "def"
- Then if I add "g", the popup shall close
How can I test (within an Espresso test) if the popup is closed?