Package org.fest.swing.test.recorder

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


    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);
      failWhenExpectingException();
    } catch (IllegalStateException e) {
      assertThatErrorCauseIsNotShowingComponent(e);
View Full Code Here


*/
public class ComponentDriver_doubleClick_Test extends ComponentDriver_TestCase {
  @Test
  public void should_double_click_Component() {
    showWindow();
    ClickRecorder clickRecorder = ClickRecorder.attachTo(window.button);
    driver.doubleClick(window.button);
    assertThat(clickRecorder).wasDoubleClicked().clickedAt(centerOf(window.button));
  }
View Full Code Here

    assertThat(clickRecorder).wasDoubleClicked().clickedAt(centerOf(window.button));
  }

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

public class JListDriver_clickItemByText_Test extends JListDriver_TestCase {
  @Test
  public void should_click_item_with_text_equal_to_given_one() {
    clearSelection();
    showWindow();
    ClickRecorder recorder = ClickRecorder.attachTo(list);
    driver.clickItem(list, "two", RIGHT_BUTTON, 2);
    assertThat(recorder).clicked(RIGHT_BUTTON).timesClicked(2);
    Point pointClicked = recorder.pointClicked();
    assertThat(locationToIndex(pointClicked)).isEqualTo(1);
  }
View Full Code Here

  @Test
  public void should_click_item_with_text_matching_given_pattern() {
    clearSelection();
    showWindow();
    ClickRecorder recorder = ClickRecorder.attachTo(list);
    driver.clickItem(list, "tw.*", RIGHT_BUTTON, 2);
    assertThat(recorder).clicked(RIGHT_BUTTON).timesClicked(2);
    Point pointClicked = recorder.pointClicked();
    assertThat(locationToIndex(pointClicked)).isEqualTo(1);
  }
View Full Code Here

  @Test
  public void should_click_Component_at_given_point() {
    showWindow();
    Point center = centerOf(window.button);
    Point where = new Point(center.x + 1, center.y + 1);
    ClickRecorder clickRecorder = ClickRecorder.attachTo(window.button);
    driver.click(window.button, where);
    assertThat(clickRecorder).wasClicked().clickedAt(where).timesClicked(1);

  }
View Full Code Here

  }

  @Test
  public void should_throw_error_if_Component_is_disabled() {
    ClickRecorder clickRecorder = ClickRecorder.attachTo(window.button);
    disableButton();
    try {
      driver.click(window.button, new Point(10, 10));
      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, new Point(10, 10));
      failWhenExpectingException();
    } catch (IllegalStateException e) {
      assertThatErrorCauseIsNotShowingComponent(e);
View Full Code Here

public class JListDriver_clickItemByPattern_Test extends JListDriver_TestCase {
  @Test
  public void should_click_item_with_text_matching_given_pattern() {
    clearSelection();
    showWindow();
    ClickRecorder recorder = ClickRecorder.attachTo(list);
    driver.clickItem(list, Pattern.compile("tw.*"), RIGHT_BUTTON, 2);
    assertThat(recorder).clicked(RIGHT_BUTTON).timesClicked(2);
    Point pointClicked = recorder.pointClicked();
    assertThat(locationToIndex(pointClicked)).isEqualTo(1);
  }
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.