Skip to content

Commit

Permalink
fix: added a waitFor JPopupMenu
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Szuc <[email protected]>
  • Loading branch information
martinszuc committed Aug 14, 2024
1 parent 162bfa1 commit 80f702f
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.util.List;

import static com.intellij.remoterobot.search.locators.Locators.byXpath;
import static com.intellij.remoterobot.utils.RepeatUtilsKt.waitFor;

/**
* Top menu fixture
Expand Down Expand Up @@ -50,6 +51,10 @@ public void navigateTo(String... path) {
JButtonFixture mainMenuFirstItem = mainMenuItem(path[0]);
if (mainMenuFirstItem != null) {
mainMenuFirstItem.click();
// Wait for the JPopupMenuFixture to appear
waitFor(Duration.ofSeconds(5), Duration.ofSeconds(1), "JPopupMenu to appear", () ->
remoteRobot.findAll(JPopupMenuFixture.class, JPopupMenuFixture.Companion.byType()).size() > 0
);
}

if (path.length == 1) {
Expand Down

0 comments on commit 80f702f

Please sign in to comment.