assertj / assertj/assertj-swing

JComboBoxFixture.selectItem() does not set focus on ComboBox

オープン
#271 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Java
スター
121
フォーク
52
PR マージ指標
30日以内にマージされた PR はありません

説明

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...?

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

JComboBoxFixture.selectItem() から始め、issue で言及されている関連する JComboBoxDriver と JComboBoxSetSelectedIndexTask を追跡します。これらの動作を JButton.doClick() のフォーカス動作と比較します。項目を選択するとユーザー操作で期待されるフォーカスが ComboBox に与えられ、関連するテストが成功すれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
desktop, testing
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
42/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。