[gui-test] add doubleClickItem(item) extension function for JListFixture to GuiTestCase and Generators

This commit is contained in:
Julia.Mochenkova
2017-05-26 17:35:03 +03:00
parent 5cbcda073c
commit a64f4c768b
2 changed files with 5 additions and 0 deletions
@@ -126,6 +126,7 @@ class JBListGenerator : ComponentCodeGenerator<JBList<*>> {
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\")"
}
}
@@ -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(