Package org.fest.swing.test.recorder

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


public class JListDriver_showPopupMenuAtItemAsText_Test extends JListDriver_showPopupMenu_TestCase {
  @Test
  public void should_show_popup_menu_at_item_with_given_value() {
    showWindow();
    driver.click(list);
    ClickRecorder recorder = ClickRecorder.attachTo(list);
    driver.showPopupMenu(list, "one");
    assertThat(recorder).clicked(RIGHT_BUTTON);
    assertThat(isVisible(popupMenu)).isTrue();
    assertThat(locationToIndex(recorder.pointClicked())).isEqualTo(0);
    assertThatCellReaderWasCalled();
  }
View Full Code Here


  @Test
  public void should_show_popup_menu_at_item_matching_pattern() {
    showWindow();
    driver.click(list);
    ClickRecorder recorder = ClickRecorder.attachTo(list);
    driver.showPopupMenu(list, "o.*");
    assertThat(recorder).clicked(RIGHT_BUTTON);
    assertThat(isVisible(popupMenu)).isTrue();
    assertThat(locationToIndex(recorder.pointClicked())).isEqualTo(0);
    assertThatCellReaderWasCalled();
  }
View Full Code Here

  @Test
  public void should_show_popup_menu() {
    showWindow();
    driver.click(table);
    ClickRecorder recorder = attachTo(table);
    TableCell cell = row(0).column(1);
    JPopupMenu found = driver.showPopupMenuAt(table, cell);
    assertThat(found).isSameAs(popupMenu);
    assertThat(recorder).clicked(RIGHT_BUTTON).timesClicked(1);
    assertThatCellWasClicked(cell, recorder.pointClicked());
  }
View Full Code Here

*/
public class JTableDriver_clickCell_Test extends JTableDriver_TestCase {
  @Test
  public void should_click_cell() {
    showWindow();
    ClickRecorder recorder = attachTo(table);
    TableCell cell = row(0).column(1);
    driver.click(table, cell, LEFT_BUTTON, 3);
    assertThat(recorder).clicked(LEFT_BUTTON).timesClicked(3);
    assertThatCellWasClicked(cell, recorder.pointClicked());
  }
View Full Code Here

  }

  @Test
  public void should_click_path() {
    showWindow();
    ClickRecorder recorder = ClickRecorder.attachTo(tree);
    driver.clickPath(tree, "root/branch1/branch1.1/branch1.1.1", mouseClickInfo);
    assertThat(recorder).clicked(RIGHT_BUTTON).timesClicked(2);
    String clickedPath = pathAtPoint(tree, recorder.pointClicked(), driver.separator());
    assertThat(clickedPath).isEqualTo("root/branch1/branch1.1/branch1.1.1");
  }
View Full Code Here

  @Test
  public void should_not_do_anything_if_cell_is_already_selected() {
    showWindow();
    clearTreeSelection();
    select(1);
    ClickRecorder recorder = ClickRecorder.attachTo(tree);
    driver.selectRow(tree, 1);
    assertThat(recorder).wasNotClicked();
    requireSelectedRows(1);
  }
View Full Code Here

*/
public class JTreeDriver_rightClickRow_Test extends JTreeDriver_clickCell_TestCase {
  @Test
  public void should_right_click_cell() {
    showWindow();
    ClickRecorder recorder = ClickRecorder.attachTo(tree);
    int row = 5;
    driver.rightClickRow(tree, row);
    assertThat(recorder).clicked(RIGHT_BUTTON).timesClicked(1);
    assertThat(rowAt(recorder.pointClicked())).isEqualTo(row);
  }
View Full Code Here

*/
public class ComponentDriver_rightClick_Test extends ComponentDriver_TestCase {
  @Test
  public void should_right_click_Component() {
    showWindow();
    ClickRecorder clickRecorder = ClickRecorder.attachTo(window.button);
    driver.rightClick(window.button);
    assertThat(clickRecorder).wasRightClicked().clickedAt(centerOf(window.button)).timesClicked(1);
  }
View Full Code Here

    assertThat(clickRecorder).wasRightClicked().clickedAt(centerOf(window.button)).timesClicked(1);
  }

  @Test
  public void should_throw_error_if_Component_is_disabled() {
    ClickRecorder clickRecorder = ClickRecorder.attachTo(window.button);
    disableButton();
    try {
      driver.rightClick(window.button);
      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.rightClick(window.button);
      failWhenExpectingException();
    } catch (IllegalStateException e) {
      assertThatErrorCauseIsNotShowingComponent(e);
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.