The Espresso's method pressBack()
is totally ignored. I'm running the test on the emulator.
What I'm testing? Just calling an Activity
, launching a second one, performing two backs, and checking that I'm out of the app.
The Espresso's method pressBack()
is totally ignored. I'm running the test on the emulator.
What I'm testing? Just calling an Activity
, launching a second one, performing two backs, and checking that I'm out of the app.
Use
import static android.support.test.espresso.Espresso.pressBack;
or
import static androidx.test.espresso.Espresso.pressBack;
instead of
import static android.support.test.espresso.action.ViewActions.pressBack;
Another solution there:
Stop using regular Espresso and start using Barista. There, clicking the back button is clickBack()
instead of pressBack()
, so it will never conflict with anything.
... and well, Barista gives a lot of more features, but I just got some karma points for this question, and asked myself why am I not having this issue anymore? Oh, because of Barista! I should introduce it here.
Feel free to check it out: https://github.com/AdevintaSpain/Barista