use of org.testfx.service.query.PointQuery in project TestFX by TestFX.
the class PointLocatorImplTest method pointFor_Bounds_atOffset.
@Test
public void pointFor_Bounds_atOffset() {
// given:
PointQuery pointQuery = pointLocator.point(new BoundingBox(100, 100, 50, 50));
// 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 PointLocatorImplTest method pointFor_Node_atOffset.
@Test
public void pointFor_Node_atOffset() {
// given:
boundsLocatorStub.bounds = nodeBounds;
PointQuery pointQuery = pointLocator.point((Node) null);
// when:
Point2D point = pointQuery.atOffset(0, 0).query();
// then:
assertThat(point, CoreMatchers.equalTo(topLeftPointFrom(nodeBounds)));
}
use of org.testfx.service.query.PointQuery in project TestFX by TestFX.
the class PointLocatorImplTest method pointFor_Window_atOffset.
@Test
public void pointFor_Window_atOffset() {
// given:
boundsLocatorStub.bounds = windowBounds;
PointQuery pointQuery = pointLocator.point((Window) null);
// when:
Point2D point = pointQuery.atOffset(0, 0).query();
// then:
assertThat(point, CoreMatchers.equalTo(topLeftPointFrom(windowBounds)));
}
use of org.testfx.service.query.PointQuery in project TestFX by TestFX.
the class PointLocatorImplTest method pointFor_Window_atOffset_afterChange.
@Test
public void pointFor_Window_atOffset_afterChange() {
// given:
boundsLocatorStub.bounds = windowBounds;
PointQuery pointQuery = pointLocator.point((Window) null);
// when:
boundsLocatorStub.bounds = windowBoundsAfterChange;
Point2D point = pointQuery.atOffset(0, 0).query();
// then:
assertThat(point, CoreMatchers.equalTo(topLeftPointFrom(windowBoundsAfterChange)));
}
use of org.testfx.service.query.PointQuery in project TestFX by TestFX.
the class ClickRobotImplTest method clickOn_with_pointQuery_and_primary_button.
@Test
public void clickOn_with_pointQuery_and_primary_button() {
// given:
PointQuery pointQuery = mock(PointQuery.class);
// when:
clickRobot.clickOn(pointQuery, MouseButton.PRIMARY);
// then:
verify(moveRobot, times(1)).moveTo(eq(pointQuery), eq(Motion.DEFAULT));
verify(mouseRobot, times(1)).pressNoWait(eq(MouseButton.PRIMARY));
verify(mouseRobot, times(1)).release(eq(MouseButton.PRIMARY));
verifyNoMoreInteractions(moveRobot, mouseRobot);
verifyZeroInteractions(sleepRobot);
}
Aggregations