Package org.fest.swing.test.recorder

Examples of org.fest.swing.test.recorder.ClickRecorder


  }

  @Test
  public void should_click_at_given_point_with_given_mouse_button_and_given_number_of_times() {
    JTextField textField = window().textField();
    ClickRecorder recorder = ClickRecorder.attachTo(textField);
    Point screenLocation = checkNotNull(locationOnScreenOf(textField));
    Point visibleCenter = visibleCenterOf(textField);
    screenLocation.translate(visibleCenter.x, visibleCenter.y);
    robot().click(screenLocation, button, times);
    assertThat(recorder).clicked(button).timesClicked(times).clickedAt(visibleCenter);
View Full Code Here


*/
public class BasicRobot_rightClickComponent_Test extends BasicRobot_TestCase {
  @Test
  public void should_rightClick_Component() {
    JTextField textField = window().textField();
    ClickRecorder recorder = attachTo(textField);
    robot().rightClick(textField);
    assertThat(recorder).clicked(RIGHT_BUTTON).timesClicked(1);
  }
View Full Code Here

*/
public class JTreeDriver_clickPath_Test extends JTreeDriver_clickCell_TestCase {
  @Test
  public void should_click_path() {
    showWindow();
    ClickRecorder recorder = ClickRecorder.attachTo(tree);
    driver.clickPath(tree, "root/branch1/branch1.1/branch1.1.1");
    assertThat(recorder).wasClicked().timesClicked(1);
    String clickedPath = pathAtPoint(tree, recorder.pointClicked(), driver.separator());
    assertThat(clickedPath).isEqualTo("root/branch1/branch1.1/branch1.1.1");
  }
View Full Code Here

    window = MyWindow.createAndShow();
  }

  @Test
  public void should_auto_scroll_when_clicking_JButton() {
    ClickRecorder recorder = attachTo(window.button);
    robot.click(window.button);
    assertThat(recorder).clicked(LEFT_BUTTON).timesClicked(1);
  }
View Full Code Here

*/
public class JTableHeaderDriver_clickColumnByPatternUsingButtonAndTimes_Test extends JTableHeaderDriver_TestCase {
  @Test
  public void should_click_column() {
    showWindow();
    ClickRecorder recorder = attachTo(tableHeader);
    driver.clickColumn(tableHeader, Pattern.compile("0.*"), LEFT_BUTTON, 3);
    assertThat(recorder).wasClickedWith(LEFT_BUTTON).timesClicked(3);
    assertThatColumnWasClicked(recorder, 0);
  }
View Full Code Here

public class ComponentDriver_invokePopupAtPoint_Test extends ComponentDriver_invokePopup_TestCase {
  @Test
  public void should_show_JPopupMenu() {
    showWindow();
    Point p = new Point(8, 6);
    ClickRecorder recorder = ClickRecorder.attachTo(window.textField);
    JPopupMenu found = driver.invokePopupMenu(window.textField, p);
    assertThat(found).isSameAs(popupMenu);
    assertThat(recorder).wasRightClicked().timesClicked(1).clickedAt(p);
  }
View Full Code Here

  }

  @Test
  public void should_click_Component_with_given_mouse_button_and_given_number_of_times_at_given_point() {
    JTextField textField = window().textField();
    ClickRecorder recorder = attachTo(textField);
    Point point = new Point(10, 10);
    robot().click(textField, point, button, times);
    assertThat(recorder).clicked(button).timesClicked(times).clickedAt(point);
  }
View Full Code Here

*/
public class BasicRobot_clickComponentAtPoint_Test extends BasicRobot_TestCase {
  @Test
  public void should_click_Component_once_with_left_button_at_given_point() {
    Point p = new Point(10, 10);
    ClickRecorder recorder = attachTo(window().textField());
    robot().click(window().textField(), p);
    assertThat(recorder).clicked(LEFT_BUTTON).timesClicked(1).clickedAt(p);
  }
View Full Code Here

    fixture.show();
  }

  @Test
  public void should_click_center_of_visible_area_of_Component_when_visible_area_is_on_the_left() {
    ClickRecorder recorder = ClickRecorder.attachTo(window.button);
    fixture.button("clickMe").click();
    assertThat(recorder).wasClicked();
  }
View Full Code Here

    assertThat(recorder).wasClicked();
  }

  @Test
  public void should_click_center_of_visible_area_of_Component_when_visible_area_is_on_the_right() {
    ClickRecorder recorder = ClickRecorder.attachTo(window.button);
    fixture.scrollPane().horizontalScrollBar().scrollToMaximum();
    fixture.button("clickMe").click();
    assertThat(recorder).wasClicked();
  }
View Full Code Here

TOP

Related Classes of org.fest.swing.test.recorder.ClickRecorder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.