android / android/android-test

"Overslept and turned a tap into a long press" should immediately fail test

Aperta
#438 3 commenti 4 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Java
Stelle
1.2k
Fork
342
Merge medio
11h 29m
PR unite (30g)
2

Descrizione

### Description

We have a flaky test that is caused by `Overslept and turned a tap into a long press`

```
09-10 18:05:56.883: I/ViewInteraction(28516): Performing 'single click' action on view with id: com.example.debug:id/action_audio_settings
...
09-10 18:05:57.508: W/MotionEvents(28516): Overslept and turned a tap into a long press
...
09-10 18:05:57.654: E/TestRunner(28516): failed: somTest(com.example.SomeTestClass)
09-10 18:05:57.654: E/TestRunner(28516): ----- begin exception -----
09-10 18:05:57.656: E/TestRunner(28516): androidx.test.espresso.NoMatchingViewException: No views in hierarchy found matching: with id: com.example:id/some_view
```

The problem is that the single click turns into long click which does not correctly nav to next screen which then leads to no matching view.

### Steps to Reproduce
Flaky test, not easily reproducible

### Expected Results
Ideally the test should fail as soon as we enter an indeterminant state. If a tap gets converted to a long press at random then who knows where the rest of the test will lead.

This makes it very difficult to track the source of the failure. I would rather the test was flaky but failed at the source of the problem (system / espresso timing).

### AndroidX Test and Android OS Versions
const val AndroidX_Junit = "androidx.test.ext:junit:1.1.1"
const val AndroidX_TestRunner = "androidx.test:runner:1.2.0"
const val AndroidX_TestRules = "androidx.test:rules:1.2.0"
const val AndroidX_Test_Orchestrator = "androidx.test:orchestrator:1.2.0"
private const val espressoVersion = "3.2.0"
const val Espresso_Core = "androidx.test.espresso:espresso-core:$espressoVersion"
const val Espresso_IdlingResource = "androidx.test.espresso:espresso-idling-resource:$espressoVersion"
const val Espresso_Contrib = "androidx.test.espresso:espresso-contrib:$espressoVersion"

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Usa il test Espresso flaky segnalato e l’avviso relativo a MotionEvents come punto di partenza; indaga dove un’azione di clic singolo viene riconosciuta come una pressione prolungata. Il lavoro è completato quando il test fallisce immediatamente durante tale conversione e segnala la condizione di origine, invece di proseguire fino all’asserzione della vista mancante.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
android, java
Ambito
mobile, testing-qa
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.