assertj / assertj/assertj-swing
JComboBoxFixture.selectItem() does not set focus on ComboBox
- Lenguaje dominante
- Java
- Estrellas
- 121
- Forks
- 52
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
I get failing tests even though my code is fine; the test is failing because `JComboBoxFixture.selectItem()` does not set focus on the ComboBox (as a user action would do).
(Background info: I am relying on the focus of ComboBoxes (or any of their subcomponents) as a trick to detect whether `ActionPerformed` or `ItemStateChanged` events are "real" ones (resulting from user actions) or "superfluous" ones (that ComboBoxes tend to throw on other inappropriate occasions.)
I verified this by debug output, but also when (visually) watching the test runnning, I notice that other UI elements (e.g. buttons) get a painted focus, while the combobox does not.
My colleague @Gleethos had a look at `JComboBoxDriver` and `JComboBoxSetSelectedIndexTask`, and we think that there should be some code setting focus (like an analogon to `JButton.doClick()`, which does set the focus for buttons).
P.S. If this is welcome, we could try to add/fix it and create a pull-request...?
Guía de contribución
Línea de trabajo
Empieza por JComboBoxFixture.selectItem() y luego sigue el JComboBoxDriver y la JComboBoxSetSelectedIndexTask relacionados que se mencionan en el issue. Compara su comportamiento con el comportamiento del foco de JButton.doClick(). Se considera terminado cuando seleccionar un elemento da al ComboBox el foco esperado de una acción del usuario y las pruebas relevantes pasan.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- java
- Área
- desktop, testing
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 42/100