Package org.fest.swing.test.recorder

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


    menuItem = window.menuNew;
  }

  @Test
  public void should_click_menu() {
    ClickRecorder clickRecorder = attachTo(menuItem);
    driver.click(menuItem);
    clickRecorder.wasClicked();
  }
View Full Code Here


*/
public class JTreeDriver_doubleClickPath_Test extends JTreeDriver_clickCell_TestCase {
  @Test
  public void should_double_click_cell() {
    showWindow();
    ClickRecorder recorder = ClickRecorder.attachTo(tree);
    driver.doubleClickPath(tree, "root");
    assertThat(recorder).clicked(MouseButton.LEFT_BUTTON).timesClicked(2);
    assertThat(rowAt(recorder.pointClicked())).isEqualTo(0);
  }
View Full Code Here

  }

  @Test
  public void should_click_column() {
    showWindow();
    ClickRecorder recorder = attachTo(tableHeader);
    driver.clickColumn(tableHeader, Pattern.compile("0.*"));
    assertThat(recorder).wasClicked();
    assertThatColumnWasClicked(recorder, 0);
  }
View Full Code Here

  }

  @Test
  public void should_click_Component_with_given_MouseClickInfo() {
    showWindow();
    ClickRecorder clickRecorder = ClickRecorder.attachTo(window.button);
    MouseClickInfo mouseClickInfo = leftButton().times(3);
    driver.click(window.button, mouseClickInfo);
    assertThat(clickRecorder).wasClickedWith(mouseClickInfo.button()).clickedAt(centerOf(window.button))
    .timesClicked(mouseClickInfo.times());
  }
View Full Code Here

    .timesClicked(mouseClickInfo.times());
  }

  @Test
  public void should_throw_error_if_Component_is_disabled() {
    ClickRecorder clickRecorder = ClickRecorder.attachTo(window.button);
    disableButton();
    try {
      driver.click(window.button, leftButton());
      failWhenExpectingException();
    } catch (IllegalStateException e) {
View Full Code Here

    assertThat(clickRecorder).wasNotClicked();
  }

  @Test
  public void should_throw_error_if_Component_is_not_showing_on_the_screen() {
    ClickRecorder clickRecorder = ClickRecorder.attachTo(window.button);
    try {
      driver.click(window.button, leftButton());
      failWhenExpectingException();
    } catch (IllegalStateException e) {
      assertThatErrorCauseIsNotShowingComponent(e);
View Full Code Here

  }

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

  }

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

public class JTableHeaderDriver_showPopupMenuByName_Test extends JTableHeaderDriver_showPopupMenu_TestCase {
  @Test
  public void should_show_popup_menu() {
    showWindow();
    driver.click(tableHeader);
    ClickRecorder recorder = attachTo(tableHeader);
    driver.showPopupMenu(tableHeader, "1");
    recorder.clicked(RIGHT_BUTTON).timesClicked(1);
    assertThatColumnWasClicked(recorder, 1);
    assertThat(isVisible(popupMenu)).isTrue();
  }
View Full Code Here

  @Test
  public void should_show_popup_menu_if_column_name_matches_pattern() {
    showWindow();
    driver.click(tableHeader);
    ClickRecorder recorder = attachTo(tableHeader);
    driver.showPopupMenu(tableHeader, "1.*");
    recorder.clicked(RIGHT_BUTTON).timesClicked(1);
    assertThatColumnWasClicked(recorder, 1);
    assertThat(isVisible(popupMenu)).isTrue();
  }
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.