douglasjunior / android-simple-tooltip

A simple library based on PopupWindow to create Tooltips on Android. 💚

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Android Espresso test case issues finding the tooltip as part of the hierarchy

brutalrisk opened this issue · comments

Am I testing with espresso framework wrong? The application I am testing is using the tooltip library and I have used the onview(withId(R.id.OK)).perform(click()) method to see if does a click in the tool tip pop up screen, but it fails because the view is not part of the hierarchy of the application.

So then I tested with the inroot methods since I saw a closed issue you mention that the tooltip behaves as an android dialog. so I did the following:

onView(withText("OK"))
.inRoot(isDialog()) // <---
.perform(click());

but it still gives me that it cannot find the view to do the action.

#30 is the issue that was closed which I would like to follow up from.

This library was created with the PopupWindow. So, you need to handle the tests on internal components just like any other PopupWindow.

@douglasjunior thank you so much for the help. This solved my problem. I thought it was a Dialog based on your previous comment from the last closed issue. The pop up window method helped.
I appreciate the responds.