Issue
When I run multiple espresso tests, I find that the app does not restart but starts from the same location that it is left off. How to make it start from the beginning everytime
Solution
Consider Android Test Orchestrator. It will clear all data and restart Instrumentation between each test.
Add to app Gradle:
android {
defaultConfig {
...
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
testOptions {
execution 'ANDROID_TEST_ORCHESTRATOR'
}
}
dependencies {
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestUtil 'com.android.support.test:orchestrator:1.0.1'
}
And then run it as follows:
./gradlew connectedCheck
Answered By - Aleksander Mielczarek
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.