From 2a5d59670670adbc13a57424dbc1e28192744ca8 Mon Sep 17 00:00:00 2001 From: Sergey Karashevich Date: Mon, 11 Sep 2017 16:44:58 +0300 Subject: [PATCH] [gui-test] filter invisible dialogs --- .../src/com/intellij/testGuiFramework/impl/GuiTestCase.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/testGuiFramework/src/com/intellij/testGuiFramework/impl/GuiTestCase.kt b/platform/testGuiFramework/src/com/intellij/testGuiFramework/impl/GuiTestCase.kt index 8bd8c7b28586..3da3ca7558a9 100644 --- a/platform/testGuiFramework/src/com/intellij/testGuiFramework/impl/GuiTestCase.kt +++ b/platform/testGuiFramework/src/com/intellij/testGuiFramework/impl/GuiTestCase.kt @@ -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() }