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.
Espresso is a testing framework that helps developers write automation test cases for user interface (UI) testing. It has been developed by Google and aims to provide a simple yet powerful framework. It allows both black-box testing as well as testing of individual components during development cycles.
One simple way to check for a View or its subclass like a Button is to use method getVisibility from View class.
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;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With