Compare commits
1 Commits
6e80198695
...
bf395a6804
Author | SHA1 | Date | |
---|---|---|---|
bf395a6804 |
@ -42,6 +42,8 @@ jobs:
|
|||||||
uses: reactivecircus/android-emulator-runner@v2
|
uses: reactivecircus/android-emulator-runner@v2
|
||||||
with:
|
with:
|
||||||
api-level: 29
|
api-level: 29
|
||||||
|
arch: x86_64
|
||||||
|
cores: 6
|
||||||
script: |
|
script: |
|
||||||
./gradlew androidApp:createScreenshotDirectory
|
./gradlew androidApp:createScreenshotDirectory
|
||||||
./gradlew JacocoDebugCodeCoverage || true
|
./gradlew JacocoDebugCodeCoverage || true
|
||||||
|
@ -153,6 +153,7 @@ open class WithANRException {
|
|||||||
"default root matcher, it may be picking a root that never takes focus. " +
|
"default root matcher, it may be picking a root that never takes focus. " +
|
||||||
"Root:",
|
"Root:",
|
||||||
)
|
)
|
||||||
|
private val otherException = "System Ul isn't responding"
|
||||||
|
|
||||||
private fun handleAnrDialogue() {
|
private fun handleAnrDialogue() {
|
||||||
val device = UiDevice.getInstance(getInstrumentation())
|
val device = UiDevice.getInstance(getInstrumentation())
|
||||||
@ -167,7 +168,10 @@ open class WithANRException {
|
|||||||
Espresso.setFailureHandler { error, viewMatcher ->
|
Espresso.setFailureHandler { error, viewMatcher ->
|
||||||
|
|
||||||
takeScreenshot()
|
takeScreenshot()
|
||||||
if (error.message!!.contains(rootViewWithoutFocusExceptionMsg) && anrCount < 3) {
|
if (error.message!!.contains(rootViewWithoutFocusExceptionMsg) &&
|
||||||
|
error.message!!.contains(otherException) &&
|
||||||
|
anrCount < 3
|
||||||
|
) {
|
||||||
anrCount++
|
anrCount++
|
||||||
handleAnrDialogue()
|
handleAnrDialogue()
|
||||||
} else { // chain all failures down to the default espresso handler
|
} else { // chain all failures down to the default espresso handler
|
||||||
|
Loading…
x
Reference in New Issue
Block a user