Search in sources :

Example 11 with Robot

use of org.fest.swing.core.Robot 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);
}
Also used : Condition(org.fest.swing.timing.Condition) Robot(org.fest.swing.core.Robot)

Example 12 with Robot

use of org.fest.swing.core.Robot in project android by JetBrains.

the class GuiTests method findAndClickButton.

public static void findAndClickButton(@NotNull ContainerFixture<? extends Container> container, @NotNull String text) {
    Robot robot = container.robot();
    new JButtonFixture(robot, GuiTests.waitUntilShowing(robot, container.target(), Matchers.byText(JButton.class, text))).click();
}
Also used : JButtonFixture(org.fest.swing.fixture.JButtonFixture) Robot(org.fest.swing.core.Robot) BasicRobot(org.fest.swing.core.BasicRobot)

Example 13 with Robot

use of org.fest.swing.core.Robot in project android by JetBrains.

the class GuiTests method findAndClickButtonWhenEnabled.

public static void findAndClickButtonWhenEnabled(@NotNull ContainerFixture<? extends Container> container, @NotNull String text) {
    Robot robot = container.robot();
    new JButtonFixture(robot, GuiTests.waitUntilShowingAndEnabled(robot, container.target(), Matchers.byText(JButton.class, text))).click();
}
Also used : JButtonFixture(org.fest.swing.fixture.JButtonFixture) Robot(org.fest.swing.core.Robot) BasicRobot(org.fest.swing.core.BasicRobot)

Aggregations

Robot (org.fest.swing.core.Robot)13 BasicRobot (org.fest.swing.core.BasicRobot)7 ElementNotFoundException (com.axway.ats.uiengine.exceptions.ElementNotFoundException)2 ProgressManager (com.intellij.openapi.progress.ProgressManager)2 IdeFrame (com.intellij.openapi.wm.IdeFrame)2 IdeFrameImpl (com.intellij.openapi.wm.impl.IdeFrameImpl)2 Dialog (java.awt.Dialog)2 Frame (java.awt.Frame)2 JInternalFrame (javax.swing.JInternalFrame)2 GenericTypeMatcher (org.fest.swing.core.GenericTypeMatcher)2 WaitTimedOutError (org.fest.swing.exception.WaitTimedOutError)2 WindowFinder.findFrame (org.fest.swing.finder.WindowFinder.findFrame)2 ContainerFixture (org.fest.swing.fixture.ContainerFixture)2 JButtonFixture (org.fest.swing.fixture.JButtonFixture)2 Condition (org.fest.swing.timing.Condition)2 AWTEvent (java.awt.AWTEvent)1 Component (java.awt.Component)1 Container (java.awt.Container)1 AWTEventListener (java.awt.event.AWTEventListener)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1