Description
Hello
I face an issue with my app
Steps :
1-I just create a simple test case (Just click on a specific button)
2-After clicking on this button, the app should be restarted to open the app again with what I click on it**(Expected Result)**
3-Testcase will fail and I get this error (Actual Result)
(Test instrumentation process crashed. Check tests.SplashActivityTest#splashActivityTest.txt for details)
The data on file mentioned before :
INSTRUMENTATION_RESULT: shortMsg=Process crashed.
INSTRUMENTATION_CODE: 0
I try with UI Automator as a recommendation from a good man here on GitHub(Try to help), but the same error still appears
Prerequisites:
android {
defaultConfig {
...
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
testInstrumentationRunnerArguments clearPackageData:'true'
} }
...
testOptions {
unitTests.returnDefaultValues = true
execution 'ANDROIDX_TEST_ORCHESTRATOR'
}
.....
dependencies {
// Espresso Dependencies
androidTestImplementation 'androidx.test:core:1.5.0-beta01'
androidTestImplementation 'androidx.test.ext:junit:1.1.4-beta01'
androidTestImplementation 'androidx.test:runner:1.4.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0-beta01'
androidTestImplementation 'com.android.support.test:rules:1.0.2'
androidTestImplementation 'androidx.test:rules:1.4.1-beta01'
androidTestImplementation 'androidx.test.ext:junit-ktx:1.1.3'
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.5.0-beta01'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.4.0'
androidTestImplementation 'com.jakewharton.espresso:okhttp3-idling-resource:1.0.0'
androidTestImplementation('com.schibsted.spain:barista:3.6.0') {
exclude group: 'org.jetbrains.kotlin'
}
// orchestrator
androidTestUtil 'androidx.test:orchestrator:1.4.1'
}
I try with API 31 and 33 with Emulator and real devices too
Is there any way to handle this step? , especially this case is required to start any test case
Thanks