From daf53e6f8973ea6db0df8352f71353538257c6a7 Mon Sep 17 00:00:00 2001 From: "Viktoria.Shirunova" Date: Mon, 3 Sep 2018 15:59:46 +0300 Subject: [PATCH] [gui-tests] added function testListItemExits --- .../testGuiFramework/impl/GuiTestCaseExt.kt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/platform/testGuiFramework/src/com/intellij/testGuiFramework/impl/GuiTestCaseExt.kt b/platform/testGuiFramework/src/com/intellij/testGuiFramework/impl/GuiTestCaseExt.kt index 8956d2345846..5563d87002e0 100644 --- a/platform/testGuiFramework/src/com/intellij/testGuiFramework/impl/GuiTestCaseExt.kt +++ b/platform/testGuiFramework/src/com/intellij/testGuiFramework/impl/GuiTestCaseExt.kt @@ -111,6 +111,20 @@ fun GuiTestCase.testTreeItemExist(name: String, vararg expectedItem: String) { } } +/** + * Performs test whether the specified item exists in a list + * Note: the dialog with the investigated list must be open + * before using this test + * @param expectedItem - expected exact item + * @param name - name of item kind, such as "Library" or "Facet". Used for understandable error message + * */ +fun GuiTestCase.testListItemExist(name: String, expectedItem: String) { + ideFrame { + logInfo("Check that $name -> $expectedItem exists in a list element") + kotlin.assert(exists { jList(expectedItem, timeout = Timeouts.noTimeout) }) { "$name '$expectedItem' not found" } + } +} + /** * Selects specified [path] in the tree by keyboard searching * @param path in string form