[gui-test] filter invisible dialogs

This commit is contained in:
Sergey Karashevich
2017-09-11 16:57:59 +03:00
parent 87e84b47a4
commit 2a5d596706
@@ -500,7 +500,7 @@ open class GuiTestCase {
val dialog = GuiTestUtilKt.withPauseWhenNull(timeoutInSeconds.toInt()) {
val allMatchedDialogs = guiTestRule.robot().finder().findAll(typeMatcher(JDialog::class.java) {
if (ignoreCaseTitle) it.title.toLowerCase() == title.toLowerCase() else it.title == title
})
}).filter { it.isShowing && it.isEnabled && it.isVisible }
if (allMatchedDialogs.size > 1) throw Exception("Found more than one (${allMatchedDialogs.size}) dialogs matched title \"$title\"")
allMatchedDialogs.firstOrNull()
}