Search in sources :

Example 6 with FxRobot

use of org.testfx.api.FxRobot in project honest-profiler by jvm-profiling-tools.

the class TreeViewTest method testTreeViewScenario.

// Actual Test Method
@Test
public void testTreeViewScenario() {
    FxRobot robot = new FxRobot();
    newProfileTab(robot, app(), 0, scenario.getName(), scenario, LOG);
    selectView(robot, TREE);
    selectThreadGrouping(robot, threadGrouping, "#tree");
    selectFrameGrouping(robot, frameGrouping, "#tree");
    clickExpandAll(robot, "#tree");
    TreeTableView<Node> tableView = getTreeTableView(robot);
    runLater(() -> scenario.checkTreeAggregation(new TreeTableViewCheckAdapter(threadGrouping, frameGrouping, tableView)));
}
Also used : TreeTableViewCheckAdapter(com.insightfullogic.honest_profiler.framework.checker.TreeTableViewCheckAdapter) Node(com.insightfullogic.honest_profiler.core.aggregation.result.straight.Node) FxRobot(org.testfx.api.FxRobot) AbstractJavaFxTest(com.insightfullogic.honest_profiler.ports.javafx.framework.AbstractJavaFxTest) Test(org.junit.Test)

Example 7 with FxRobot

use of org.testfx.api.FxRobot in project honest-profiler by jvm-profiling-tools.

the class FlatViewQuickFilterTest method testFlatQuickFilterScenario.

@Test
public void testFlatQuickFilterScenario() {
    FxRobot robot = new FxRobot();
    newProfileTab(robot, app(), 0, scenario.getName(), scenario, LOG);
    selectView(robot, FLAT);
    focusOn(robot, "#quickFilterText", "#flat");
    robot.write("ba");
    clickQuickFilterButton(robot, "#flat");
    checkResult(robot, keyFlt(s -> s.contains("ba")));
    selectView(robot, FLAT);
    focusOn(robot, "#quickFilterText", "#flat");
    robot.type(BACK_SPACE, BACK_SPACE, ENTER);
    checkResult(robot);
}
Also used : AbstractJavaFxTest(com.insightfullogic.honest_profiler.ports.javafx.framework.AbstractJavaFxTest) BACK_SPACE(javafx.scene.input.KeyCode.BACK_SPACE) HPFXUtil.focusOn(com.insightfullogic.honest_profiler.ports.javafx.framework.HPFXUtil.focusOn) RunWith(org.junit.runner.RunWith) Parameters(org.junit.runners.Parameterized.Parameters) HPFXUtil.clickQuickFilterButton(com.insightfullogic.honest_profiler.ports.javafx.framework.HPFXUtil.clickQuickFilterButton) ParameterUtil.getScenarios(com.insightfullogic.honest_profiler.framework.ParameterUtil.getScenarios) LOG(com.insightfullogic.honest_profiler.ports.javafx.model.ProfileContext.ProfileMode.LOG) FlatTableViewCheckAdapter(com.insightfullogic.honest_profiler.framework.checker.FlatTableViewCheckAdapter) Arrays.asList(java.util.Arrays.asList) ScenarioStraightFilter.keyFlt(com.insightfullogic.honest_profiler.framework.scenario.ScenarioStraightFilter.keyFlt) Entry(com.insightfullogic.honest_profiler.core.aggregation.result.straight.Entry) FLAT(com.insightfullogic.honest_profiler.ports.javafx.ViewType.FLAT) FxRobot(org.testfx.api.FxRobot) TableView(javafx.scene.control.TableView) ALL_TOGETHER(com.insightfullogic.honest_profiler.core.aggregation.grouping.ThreadGrouping.ALL_TOGETHER) FrameGrouping(com.insightfullogic.honest_profiler.core.aggregation.grouping.FrameGrouping) Parameterized(org.junit.runners.Parameterized) HPFXUtil.newProfileTab(com.insightfullogic.honest_profiler.ports.javafx.framework.HPFXUtil.newProfileTab) HPFXUtil.selectFrameGrouping(com.insightfullogic.honest_profiler.ports.javafx.framework.HPFXUtil.selectFrameGrouping) Collection(java.util.Collection) Test(org.junit.Test) SimplifiedLogScenario(com.insightfullogic.honest_profiler.framework.scenario.SimplifiedLogScenario) HPFXUtil.selectView(com.insightfullogic.honest_profiler.ports.javafx.framework.HPFXUtil.selectView) HPFXUtil.getFlatTableView(com.insightfullogic.honest_profiler.ports.javafx.framework.HPFXUtil.getFlatTableView) ENTER(javafx.scene.input.KeyCode.ENTER) Ignore(org.junit.Ignore) ScenarioStraightFilter(com.insightfullogic.honest_profiler.framework.scenario.ScenarioStraightFilter) FxRobot(org.testfx.api.FxRobot) AbstractJavaFxTest(com.insightfullogic.honest_profiler.ports.javafx.framework.AbstractJavaFxTest) Test(org.junit.Test)

Example 8 with FxRobot

use of org.testfx.api.FxRobot in project honest-profiler by jvm-profiling-tools.

the class FlatViewTest method testFlatViewScenario.

// Actual Test Method
@Test
public void testFlatViewScenario() {
    FxRobot robot = new FxRobot();
    newProfileTab(robot, app(), 0, scenario.getName(), scenario, LOG);
    selectView(robot, FLAT);
    selectFrameGrouping(robot, frameGrouping, "#flat");
    TableView<Entry> tableView = getFlatTableView(robot);
    runLater(() -> scenario.checkFlatAggregation(new FlatTableViewCheckAdapter(BY_ID, frameGrouping, tableView)));
}
Also used : Entry(com.insightfullogic.honest_profiler.core.aggregation.result.straight.Entry) FxRobot(org.testfx.api.FxRobot) FlatTableViewCheckAdapter(com.insightfullogic.honest_profiler.framework.checker.FlatTableViewCheckAdapter) AbstractJavaFxTest(com.insightfullogic.honest_profiler.ports.javafx.framework.AbstractJavaFxTest) Test(org.junit.Test)

Example 9 with FxRobot

use of org.testfx.api.FxRobot in project TestFX by TestFX.

the class GlassRobotClipboardBug method setupSpec.

/*
    static {
        System.setProperty("testfx.robot", "glass");
        System.setProperty("testfx.headless", "true");
        System.setProperty("prism.order", "sw");
    }
    */
@BeforeClass
public static void setupSpec() throws Exception {
    FxToolkit.registerPrimaryStage();
    fx = new FxRobot();
}
Also used : FxRobot(org.testfx.api.FxRobot) BeforeClass(org.junit.BeforeClass)

Example 10 with FxRobot

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

the class MoveShape method testCanCancelDnDWithObsList.

@Test
public void testCanCancelDnDWithObsList(final FxRobot robot) {
    new NodeBinder<>(new DnD(true, true), i -> new MoveShape((Rectangle) i.getSrcObject().get()), instrument).on(widget1.getChildren()).first((i, c) -> Platform.runLater(() -> i.getSrcObject().get().requestFocus())).then((i, c) -> c.setCoord(((Rectangle) i.getSrcObject().get()).getX() + (i.getTgtScenePoint().getX() - i.getSrcScenePoint().getX()), ((Rectangle) i.getSrcObject().get()).getY() + (i.getTgtScenePoint().getY() - i.getSrcScenePoint().getY()))).end((i, c) -> fail("")).exec().bind();
    final Rectangle rec2 = new Rectangle(200d, 200d, 70d, 50d);
    Platform.runLater(() -> widget1.getChildren().addAll(rec2));
    WaitForAsyncUtils.waitForFxEvents();
    robot.drag(rec2).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) Rectangle(javafx.scene.shape.Rectangle) 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