From a3411d778b1ca5bacfd2fd69b289965dbbb20163 Mon Sep 17 00:00:00 2001 From: Sergey Karashevich Date: Mon, 26 Dec 2016 22:10:14 +0300 Subject: [PATCH] [gui-test] fix jList() --- .../com/intellij/testGuiFramework/framework/GuiTestUtil.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platform/testGuiFramework/src/com/intellij/testGuiFramework/framework/GuiTestUtil.java b/platform/testGuiFramework/src/com/intellij/testGuiFramework/framework/GuiTestUtil.java index 1010a3726903..c022a6709715 100644 --- a/platform/testGuiFramework/src/com/intellij/testGuiFramework/framework/GuiTestUtil.java +++ b/platform/testGuiFramework/src/com/intellij/testGuiFramework/framework/GuiTestUtil.java @@ -548,7 +548,8 @@ GuiTestUtil { // First find the JBList which holds the popup. There could be other JBLists in the hierarchy, // so limit it to one that is actually used as a popup, as identified by its model being a ListPopupModel: assertNotNull(root); - JBList list = robot.finder().find(root, new GenericTypeMatcher(JBList.class) { + + JBList list = waitUntilFound(robot, new GenericTypeMatcher(JBList.class) { @Override protected boolean isMatching(@NotNull JBList list) { ListModel model = list.getModel(); @@ -556,6 +557,7 @@ GuiTestUtil { } }); + // We can't use the normal JListFixture method to click by label since the ListModel items are // ActionItems whose toString does not reflect the text, so search through the model items instead: ListPopupModel model = (ListPopupModel)list.getModel();