use of org.testfx.service.query.PointQuery in project TestFX by TestFX.
the class CallableBoundsPointQuery method query.
@Override
public Point2D query() {
Bounds bounds = fetchCallableBounds();
PointQuery boundsQuery = new BoundsPointQuery(bounds).atPosition(getPosition()).atOffset(getOffset());
return boundsQuery.query();
}
use of org.testfx.service.query.PointQuery in project TestFX by TestFX.
the class PointLocatorImplTest method pointFor_Node_atOffset_afterChange.
@Test
public void pointFor_Node_atOffset_afterChange() {
// given:
boundsLocatorStub.bounds = nodeBounds;
PointQuery pointQuery = pointLocator.point((Node) null);
// when:
boundsLocatorStub.bounds = nodeBoundsAfterChange;
Point2D point = pointQuery.atOffset(0, 0).query();
// then:
assertThat(point, CoreMatchers.equalTo(topLeftPointFrom(nodeBoundsAfterChange)));
}
use of org.testfx.service.query.PointQuery in project TestFX by TestFX.
the class PointLocatorImplTest method pointFor_Scene_atOffset.
@Test
public void pointFor_Scene_atOffset() {
// given:
boundsLocatorStub.bounds = sceneBounds;
PointQuery pointQuery = pointLocator.point((Scene) null);
// when:
Point2D point = pointQuery.atOffset(0, 0).query();
// then:
assertThat(point, CoreMatchers.equalTo(topLeftPointFrom(sceneBounds)));
}
use of org.testfx.service.query.PointQuery in project TestFX by TestFX.
the class PointLocatorImplTest method pointFor_Point2D_atOffset.
@Test
public void pointFor_Point2D_atOffset() {
// given:
boundsLocatorStub.bounds = nodeBounds;
PointQuery pointQuery = pointLocator.point(new Point2D(100, 100));
// when:
Point2D point = pointQuery.atOffset(0, 0).query();
// then:
assertThat(point, CoreMatchers.equalTo(new Point2D(100, 100)));
}
use of org.testfx.service.query.PointQuery in project TestFX by TestFX.
the class ClickRobotImplTest method doubleClickOn_with_pointQuery_and_primary_button.
@Test
public void doubleClickOn_with_pointQuery_and_primary_button() {
// given:
PointQuery pointQuery = mock(PointQuery.class);
// when:
clickRobot.doubleClickOn(pointQuery, MouseButton.PRIMARY);
// then:
verify(moveRobot, times(1)).moveTo(eq(pointQuery), eq(Motion.DEFAULT));
verify(mouseRobot, times(2)).pressNoWait(eq(MouseButton.PRIMARY));
verify(mouseRobot, times(2)).release(eq(MouseButton.PRIMARY));
verify(sleepRobot, times(1)).sleep(anyLong());
verifyNoMoreInteractions(moveRobot, mouseRobot, sleepRobot);
}
Aggregations