Use Android Test Orchestrator to have a clean state for each test

fixes flaky/broken espresso tests
This commit is contained in:
Torsten Grote
2021-03-22 14:39:51 -03:00
parent 51624a31e3
commit a12166c13b
8 changed files with 22 additions and 25 deletions

View File

@@ -37,7 +37,7 @@ android {
buildConfigField "Long", "BuildTimestamp",
"${getStdout(['git', 'log', '-n', '1', '--format=%ct'], now)}000L"
testInstrumentationRunner 'org.briarproject.briar.android.BriarTestRunner'
testInstrumentationRunnerArguments disableAnalytics: 'true'
testInstrumentationRunnerArguments disableAnalytics: 'true', clearPackageData: 'true'
}
buildTypes {
@@ -80,6 +80,7 @@ android {
}
testOptions {
execution 'ANDROIDX_TEST_ORCHESTRATOR'
unitTests {
includeAndroidResources = true
}
@@ -148,6 +149,8 @@ dependencies {
androidTestImplementation "androidx.test.espresso:espresso-core:$espressoVersion"
androidTestImplementation "androidx.test.espresso:espresso-contrib:$espressoVersion"
androidTestImplementation "androidx.test.espresso:espresso-intents:$espressoVersion"
androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestUtil 'androidx.test:orchestrator:1.3.0'
androidTestAnnotationProcessor "com.google.dagger:dagger-compiler:2.24"
androidTestCompileOnly 'javax.annotation:jsr250-api:1.0'
androidTestImplementation 'junit:junit:4.13.1'