Search in sources :

Example 11 with FxRobot

use of org.testfx.api.FxRobot in project Malai by arnobl.

the class MoveShape method testCanCancelDnD.

@Test
public void testCanCancelDnD(final FxRobot robot) {
    new NodeBinder<>(new DnD(true, true), i -> new MoveShape(rec), instrument).on(rec).first((i, c) -> rec.requestFocus()).then((i, c) -> c.setCoord(rec.getX() + (i.getTgtScenePoint().getX() - i.getSrcScenePoint().getX()), rec.getY() + (i.getTgtScenePoint().getY() - i.getSrcScenePoint().getY()))).end((i, c) -> fail("")).exec().bind();
    robot.drag(rec).moveBy(100, 100).type(KeyCode.ESCAPE).sleep(50L);
    assertEquals(0, instrument.exec.get());
}
Also used : Assertions.fail(org.junit.jupiter.api.Assertions.fail) KeyCode(javafx.scene.input.KeyCode) NodeBinder(org.malai.javafx.binding.NodeBinder) Undoable(org.malai.undo.Undoable) Rectangle(javafx.scene.shape.Rectangle) DoubleProperty(javafx.beans.property.DoubleProperty) CommandImpl(org.malai.command.CommandImpl) WaitForAsyncUtils(org.testfx.util.WaitForAsyncUtils) Platform(javafx.application.Platform) Test(org.junit.jupiter.api.Test) ResourceBundle(java.util.ResourceBundle) Stage(javafx.stage.Stage) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) SimpleDoubleProperty(javafx.beans.property.SimpleDoubleProperty) FxRobot(org.testfx.api.FxRobot) Start(org.testfx.framework.junit5.Start) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) DnD(org.malai.javafx.interaction.library.DnD) ApplicationExtension(org.testfx.framework.junit5.ApplicationExtension) Pane(javafx.scene.layout.Pane) DnD(org.malai.javafx.interaction.library.DnD) NodeBinder(org.malai.javafx.binding.NodeBinder) Test(org.junit.jupiter.api.Test)

Aggregations

FxRobot (org.testfx.api.FxRobot)11 AbstractJavaFxTest (com.insightfullogic.honest_profiler.ports.javafx.framework.AbstractJavaFxTest)7 Test (org.junit.Test)7 FrameGrouping (com.insightfullogic.honest_profiler.core.aggregation.grouping.FrameGrouping)3 Entry (com.insightfullogic.honest_profiler.core.aggregation.result.straight.Entry)3 Node (com.insightfullogic.honest_profiler.core.aggregation.result.straight.Node)3 ThreadGrouping (com.insightfullogic.honest_profiler.core.aggregation.grouping.ThreadGrouping)2 DiffEntry (com.insightfullogic.honest_profiler.core.aggregation.result.diff.DiffEntry)2 DiffNode (com.insightfullogic.honest_profiler.core.aggregation.result.diff.DiffNode)2 ParameterUtil.getScenarios (com.insightfullogic.honest_profiler.framework.ParameterUtil.getScenarios)2 FlatTableViewCheckAdapter (com.insightfullogic.honest_profiler.framework.checker.FlatTableViewCheckAdapter)2 TreeTableViewCheckAdapter (com.insightfullogic.honest_profiler.framework.checker.TreeTableViewCheckAdapter)2 ScenarioStraightFilter (com.insightfullogic.honest_profiler.framework.scenario.ScenarioStraightFilter)2 ScenarioStraightFilter.keyFlt (com.insightfullogic.honest_profiler.framework.scenario.ScenarioStraightFilter.keyFlt)2 SimplifiedLogScenario (com.insightfullogic.honest_profiler.framework.scenario.SimplifiedLogScenario)2 HPFXUtil.clickQuickFilterButton (com.insightfullogic.honest_profiler.ports.javafx.framework.HPFXUtil.clickQuickFilterButton)2 HPFXUtil.focusOn (com.insightfullogic.honest_profiler.ports.javafx.framework.HPFXUtil.focusOn)2 HPFXUtil.newProfileTab (com.insightfullogic.honest_profiler.ports.javafx.framework.HPFXUtil.newProfileTab)2 HPFXUtil.selectFrameGrouping (com.insightfullogic.honest_profiler.ports.javafx.framework.HPFXUtil.selectFrameGrouping)2 ResourceBundle (java.util.ResourceBundle)2