android / android/android-test
isDisplayingAtLeast does not check whether a parent obscures the view
- Lenguaje dominante
- Java
- Estrellas
- 1.2k
- Forks
- 342
- Merge medio
- 11 h 29 min
- PR fusionados (30 d)
- 2
Descripción
### Description
According to the [documentation](https://developer.android.com/reference/android/support/test/espresso/matcher/ViewMatchers.html#isdisplayingatleast) isDisplayingAtLeast:
> Returns a matcher which accepts a view so long as a given percentage of that view's area **is not obscured by any parent view** and is thus visible to the user.
That's not what happens. It actuality the matcher only checks whether a sufficient portion of the view area is within the boundaries of the screen. It's evident from examining the code of `IsDisplayingAtLeastMatcher#matchesSafely`.
### Steps to Reproduce
Make the parent view clip a portion of the child view, e.g.:
```jsx
```
only 74% of the child view will be visible to the user, the bottom 26% will be clipped by the parent. Both views will render within the boundaries of the screen.
### Expected Results
`isDisplayingAtLeast(75)` should fail.
### Actual Results
`isDisplayingAtLeast(75)` passes even though only 74% is displayed.
### AndroidX Test and Android OS Versions
Android 9, espresso-core 3.1.1
Guía de contribución
Línea de trabajo
Comienza en IsDisplayingAtLeastMatcher#matchesSafely y reproduce el caso proporcionado de recorte de parent/child. Traza cómo se calcula el área mostrada y, a continuación, verifica que isDisplayingAtLeast(75) falla cuando el parent recorta el 26 % del child, mientras que un caso no obstruido sigue pasando.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- java
- Área
- mobile-dev, testing
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bien especificado
- Aptitud para principiantes
- 45/100