From a64f4c768b79360d2b3df2c18898d359049f5f94 Mon Sep 17 00:00:00 2001 From: "Julia.Mochenkova" Date: Fri, 26 May 2017 17:33:40 +0300 Subject: [PATCH] [gui-test] add doubleClickItem(item) extension function for JListFixture to GuiTestCase and Generators --- .../com/intellij/testGuiFramework/generators/Generators.kt | 1 + .../src/com/intellij/testGuiFramework/impl/GuiTestCase.kt | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/platform/testGuiFramework/src/com/intellij/testGuiFramework/generators/Generators.kt b/platform/testGuiFramework/src/com/intellij/testGuiFramework/generators/Generators.kt index 56ecd82c6f38..63875109481f 100644 --- a/platform/testGuiFramework/src/com/intellij/testGuiFramework/generators/Generators.kt +++ b/platform/testGuiFramework/src/com/intellij/testGuiFramework/generators/Generators.kt @@ -126,6 +126,7 @@ class JBListGenerator : ComponentCodeGenerator> { val cellText = getCellText(cmp, cp).orEmpty() if (cmp.isPopupList()) return "popupClick(\"$cellText\")" if (me.button == MouseEvent.BUTTON2) return "jList(\"$cellText\").item(\"$cellText\").rightClick()" + if (me.clickCount == 2) return "jList(\"$cellText\").doubleClickItem(\"$cellText\")" return "jList(\"$cellText\").clickItem(\"$cellText\")" } } diff --git a/platform/testGuiFramework/src/com/intellij/testGuiFramework/impl/GuiTestCase.kt b/platform/testGuiFramework/src/com/intellij/testGuiFramework/impl/GuiTestCase.kt index dffe2ea5ea1b..993b73b49967 100644 --- a/platform/testGuiFramework/src/com/intellij/testGuiFramework/impl/GuiTestCase.kt +++ b/platform/testGuiFramework/src/com/intellij/testGuiFramework/impl/GuiTestCase.kt @@ -378,6 +378,10 @@ open class GuiTestCase : GuiTestBase() { //*********SOME EXTENSION FUNCTIONS FOR FIXTURES + fun JListFixture.doubleClickItem(itemName: String) { + this.item(itemName).doubleClick() + } + //necessary only for Windows fun getScaleSuffix(): String? { val scaleEnabled: Boolean = (GuiTestUtil.getSystemPropertyOrEnvironmentVariable("sun.java2d.uiScale.enabled")?.toLowerCase().equals(