android / android/android-test
Espresso Hangs with TextInputLayout.setError
- Lingua principale
- Java
- Stelle
- 1.2k
- Fork
- 342
- Merge medio
- 11h 29m
- PR unite (30g)
- 2
Descrizione
### Description
`TextInputLayout.setError` causes Espresso test to hang indefinitely. I believe this issue is specific to TextInputLayouts that are in dialogs.
### Steps to Reproduce
Simply run the `TextInputErrorTest` included in the linked GitHub project.
### Expected Results
The test should complete and pass as written.
### Actual Results
Espresso will hang indefinitely after clicking the "OK" button. The app itself works fine, but the test will hang and never return. I believe I've tracked this down to `Tap.java` line 170, espresso fails to return from `MotionEvents.sendUp`.
### AndroidX Test and Android OS Versions
Tested on Pixel 4 (Android 10), Emulator (Android 9) and a few other devices.
`implementation 'androidx.constraintlayout:constraintlayout:1.1.3'`
`implementation 'androidx.test.ext:junit:1.1.1'`
`androidTestImplementation 'androidx.test:runner:1.2.0'`
`androidTestImplementation 'androidx.test:rules:1.2.0'`
`androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'`
`androidTestImplementation 'androidx.annotation:annotation:1.1.0'`
`androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.2.0'`
`androidTestImplementation 'androidx.test.espresso:espresso-intents:3.2.0'`
`androidTestImplementation 'androidx.test.espresso:espresso-web:3.2.0'`
`androidTestImplementation 'androidx.test.espresso.idling:idling-concurrent:3.2.0'`
`androidTestImplementation 'androidx.test.espresso:espresso-idling-resource:3.2.0'`
`androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'`
`implementation 'com.google.android.material:material:1.1.0'`
### Link to a public git repo demonstrating the problem:
https://github.com/nverbeek/EspressoBug
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia eseguendo il TextInputErrorTest collegato nel progetto di riproduzione EspressoBug e conferma che il test si blocca dopo aver fatto clic su «OK» quando TextInputLayout.setError viene usato in una finestra di dialogo. Poi esamina Tap.java intorno alla riga 170, dove il report identifica MotionEvents.sendUp come il punto in cui non avviene il ritorno. Il lavoro è completato quando il test di riproduzione termina e ha esito positivo sulle versioni interessate di Android ed Espresso.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- java
- Ambito
- mobile-dev, testing
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100