android / android/android-test
Customizing string rendering of view hierarchy
- Lingua principale
- Java
- Stelle
- 1.2k
- Fork
- 342
- Merge medio
- 11h 29m
- PR unite (30g)
- 2
Descrizione
### Description
@zach-klippenstein and I are working on releasing https://github.com/square/radiography , a utility that renders both Android & Compose view hierarchies to readable strings.
Espresso errors include a string rendering of the view hierarchy, unfortunately that rendering is not as human readable as it could be.
At Square, I've replaced Espresso's string rendering with the output from Radiography. I did that with a giant hack, setting a FailureHandler delegate and using reflection to replace the Throwable's `detailMessage` field 💩💩💩. Shared in a tweet here: https://twitter.com/Piwai/status/1291771701584252928
It would be great if Espresso would provide a hook to set up a view hierarchy renderer. Also, if you feel comfortable with it, it could depend directly on Radiography in some way or offer it as an alternate impl (might be more involve to sign off on that?).
If you're ok with the idea of adding such an API I'm happy to open up a PR and we can take it from there.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia individuando i punti di ingresso di Espresso per la gestione dei fallimenti e il rendering della gerarchia delle view. Chiarisci l'API per selezionare un renderer personalizzato, incluso se Radiography debba essere una dipendenza diretta o un'implementazione alternativa, e conferma che il design scelto possa sostituire l'approccio attuale basato sulla reflection.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- java
- Ambito
- mobile, testing
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 30/100