use of org.fest.swing.timing.Condition in project intellij-community by JetBrains.
the class GuiTestUtil method findAndClickButtonWhenEnabled.
public static void findAndClickButtonWhenEnabled(@NotNull ContainerFixture<? extends Container> container, @NotNull final String text) {
Robot robot = container.robot();
final JButton button = findButton(container, text, robot);
Pause.pause(new Condition("Wait for button " + text + " to be enabled.") {
@Override
public boolean test() {
return button.isEnabled() && button.isVisible() && button.isShowing();
}
}, SHORT_TIMEOUT);
robot.click(button);
}
Aggregations