android / android/android-test

Flaky Espresso.intended() won't find anything sometimes

Offen
#644 5 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Java
Sterne
1.2k
Forks
342
Ø Merge
11 Std. 29 Min.
Gemergte PRs (30 T.)
2

Beschreibung

### Description
Flaky Espresso.intended() won't find anything sometimes.

### Steps to Reproduce
Run the test proveEspressoIntendedIssue0 here: https://github.com/mobilekosmos/EspressoDialogsIssue/blob/master/app/src/androidTest/java/com/issues/espressoidling/MainActivity2Test.kt

The issue doesn't only happen because of using the loop, this is also happening when running the test manually, but difficult to reproduce when doing so, it works a few times, then it doesn't, therefore the loop where it was always reproducible till now on a Pixel 3a.

### Expected Results
Espresso.intended() shuould always find a view.

### Actual Results
Sometimes Espresso.intended() will hang and not find anything.

### AndroidX Test and Android OS Versions
Android R Preview 4
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'androidx.test.espresso:espresso-idling-resource:3.1.1'
androidTestImplementation("androidx.test.espresso:espresso-intents:3.2.0")

### Link to a public git repo demonstrating the problem:
https://github.com/mobilekosmos/EspressoDialogsIssue/blob/master/app/src/androidTest/java/com/issues/espressoidling/MainActivity2Test.kt

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne damit, proveEspressoIntendedIssue0 in app/src/androidTest/java/com/issues/espressoidling/MainActivity2Test.kt aus dem verknüpften Reproduktions-Repository mit den aufgeführten Versionen von AndroidX Test und Android R Preview 4 auszuführen. Untersuche, warum Espresso.intended() intermittierend hängt oder keine View findet; abgeschlossen ist die Aufgabe, wenn der Test die erwartete View bei wiederholten Ausführungen zuverlässig findet.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
android, kotlin
Bereich
mobile-dev, testing
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.