android - Espresso Instrumentation Tests - how to uninstall or delete the app after the test -
i setup espresso instrumentation framework run android functional automation tests. every test, want login app , delete app after finish test.
so, setup below:
public class firstsampletest extends basetest {
private final basetest basetest;
// private final elementutils elementutils;
public firstsampletest() throws interruptedexception { this.basetest = new basetest(); } @before public void initiate() throws interruptedexception { //i have setup login method here login app after installs } @rule public activitytestrule<splashscreenactivity> splashscreenactivityactivitytestrule = new activitytestrule(splashscreenactivity.class); @test public void testthehomescreen() throws interruptedexception { //some tests go here. } @after public void teardown() throws interruptedexception { //i want uninstall app or delete emulator once test run } }
uninstalling app instrumentation tests not possible. however, once tests run, app uninstalled automatically.
note: app not uninstalled when single test run. please run whole build using command ./gradlew connectedandroidtest
Comments
Post a Comment