use of org.testfx.service.query.PointQuery in project TestFX by TestFX.
the class MoveRobotImplTest method moveTo_a_point_with_motion_DIRECT.
@Test
public void moveTo_a_point_with_motion_DIRECT() {
// given:
Point2D sourcePoint = new Point2D(0, 0);
given(baseRobot.retrieveMouse()).willReturn(sourcePoint);
// and:
Point2D targetPoint = new Point2D(300, 100);
PointQuery pointQuery = mock(PointQuery.class);
given(pointQuery.query()).willReturn(targetPoint);
// when:
moveRobot.moveTo(pointQuery, Motion.DIRECT);
// then:
verify(mouseRobot, times(199)).moveNoWait(argThat(argument -> sourcePoint.getY() != argument.getY() || targetPoint.getX() != argument.getX()));
verify(mouseRobot, times(2)).move(targetPoint);
}
use of org.testfx.service.query.PointQuery in project TestFX by TestFX.
the class NodeAndPointQueryTest method point_query_returns_point.
@Test
public void point_query_returns_point() {
// when:
PointQuery pointQuery = fx.point(".button");
// then:
assertThat(pointQuery.query(), instanceOf(Point2D.class));
}
Aggregations