android / android/android-test
Espresso.openActionBarOverflowOrOptionsMenu sometimes performs long click
- Vorherrschende Sprache
- Java
- Sterne
- 1.2k
- Forks
- 342
- Ø Merge
- 11 Std. 29 Min.
- Gemergte PRs (30 T.)
- 2
Beschreibung
### Description
Inside openActionBarOverflowOrOptionsMenu is a call to ViewActions.click(). Creating click actions this way is flaky on devices that are prone to interpret short-clicks as long-clicks. It would be preferred to use the ViewAction.click(ViewAction rollbackAction) constructor instead, or least provide the option.
### Steps to Reproduce
Run an Espresso test which calls openActionBarOverflowOrOptionsMenu on A.) slow device, or B.) any device with a very short long-click timeout (you can configure this via ADB: `adb shell settings put secure long_press_timeout 10`).
### Expected Results
If a long-click is accidentally performed, Espresso will be given a chance to roll-back its effects before re-trying it.
### Actual Results
Espresso performs an undesirable long-click; the test does not proceed as expected.
### AndroidX Test and Android OS Versions
AndroidX: 1.2.0
Espresso: 3.2.0
Android OS: API 23
### Link to a public git repo demonstrating the problem:
Unfortunately I am not permitted to share my employer's code.
Beitragsleitfaden
Rechercherichtung
Beginne bei Espresso.openActionBarOverflowOrOptionsMenu und untersuche den im Issue beschriebenen Aufruf von ViewActions.click(). Reproduziere das Problem mit einem Espresso-Test auf einem langsamen Gerät oder mit dem über adb reduzierten Long-Press-Timeout. Als erledigt gilt die Aufgabe, wenn versehentliche Auswirkungen eines langen Drucks vor dem erneuten Versuch zurückgesetzt werden oder die angeforderte Rollback-Option verfügbar ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java
- Bereich
- mobile, testing
- Issue-Typ
- Bug
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Aktivitätsstatus
- Veraltet
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 35/100