use of org.testfx.api.FxRobot in project honest-profiler by jvm-profiling-tools.
the class FlatDiffViewTest method testFlatDiffViewScenario.
// Actual Test Method
@Test
public void testFlatDiffViewScenario() {
FxRobot robot = new FxRobot();
waitUntil(asyncFx(() -> getMainStage().setMaximized(true)));
newProfileTab(robot, app(), 0, "Base : " + baseScenario.getName(), baseScenario, LOG);
newProfileTab(robot, app(), 1, "New : " + newScenario.getName(), newScenario, LOG);
selectTab(robot, 1);
selectCtxMenu(robot, "#compareButton", 0, "Base : " + baseScenario.getName());
selectTab(robot, 2);
selectView(robot, FLAT);
selectFrameGrouping(robot, frameGrouping, "#flat");
TableView<DiffEntry> tableView = getFlatDiffTableView(robot);
newScenario.checkFlatDiffAggregation(baseScenario, new FlatDiffTableViewCheckAdapter(BY_ID, frameGrouping, tableView));
}
use of org.testfx.api.FxRobot in project honest-profiler by jvm-profiling-tools.
the class TreeViewQuickFilterTest method testTreeQuickFilterScenario.
// Actual Test Method
@Test
public void testTreeQuickFilterScenario() {
FxRobot robot = new FxRobot();
newProfileTab(robot, app(), 0, scenario.getName(), scenario, LOG);
selectView(robot, TREE);
focusOn(robot, "#quickFilterText", "#tree");
robot.write("ba");
clickQuickFilterButton(robot, "#tree");
checkResult(robot, keyFlt(s -> s.contains("ba")));
selectView(robot, TREE);
focusOn(robot, "#quickFilterText", "#tree");
robot.type(BACK_SPACE, BACK_SPACE, ENTER);
checkResult(robot);
}
use of org.testfx.api.FxRobot in project honest-profiler by jvm-profiling-tools.
the class HPFXUtil method newProfileTab.
// Profile Creation
public static final void newProfileTab(FxRobot robot, JavaFXApplication application, int expectedIndex, String name, LogScenario scenario, ProfileMode mode) {
TabPane tabPane = robot.lookup("#profileTabs").query();
waitUntil(() -> tabPane.isVisible());
assertEquals(expectedIndex, tabPane.getTabs().size());
ProfileContextGenerator gen = new ProfileContextGenerator(application, name, mode);
waitUntil(asyncFx(() -> gen.createNewProfile(scenario)));
waitUntil(() -> tabPane.getTabs().size() == expectedIndex + 1);
Tab tab = tabPane.getTabs().get(expectedIndex);
waitUntil(() -> ((Parent) tab.getGraphic()).getChildrenUnmodifiable().stream().filter(node -> node instanceof Label && name.equals(((Label) node).getText())).findFirst().isPresent());
}
use of org.testfx.api.FxRobot in project honest-profiler by jvm-profiling-tools.
the class SampleCountTest method testSampleCount.
// Actual Test Method
@Test
public void testSampleCount() {
FxRobot robot = new FxRobot();
newProfileTab(robot, app(), 0, scenario.getName(), scenario, LOG);
Label label = robot.lookup("#profileSampleCount").query();
waitUntil(() -> label.getText() != null && !label.getText().isEmpty());
assertEquals(scenario.getTraceCount() + " samples", label.getText());
}
use of org.testfx.api.FxRobot in project honest-profiler by jvm-profiling-tools.
the class TreeDiffViewTest method testTreeDiffViewScenario.
// Actual Test Method
@Test
public void testTreeDiffViewScenario() {
FxRobot robot = new FxRobot();
waitUntil(asyncFx(() -> getMainStage().setMaximized(true)));
newProfileTab(robot, app(), 0, "Base : " + baseScenario.getName(), baseScenario, LOG);
newProfileTab(robot, app(), 1, "New : " + newScenario.getName(), newScenario, LOG);
selectTab(robot, 1);
selectCtxMenu(robot, "#compareButton", 0, "Base : " + baseScenario.getName());
selectTab(robot, 2);
selectView(robot, TREE);
selectFrameGrouping(robot, frameGrouping, "#tree");
selectThreadGrouping(robot, threadGrouping, "#tree");
clickExpandAll(robot, "#tree");
TreeTableView<DiffNode> tableView = getTreeDiffTableView(robot);
newScenario.checkTreeDiffAggregation(baseScenario, new TreeDiffTableViewCheckAdapter(threadGrouping, frameGrouping, tableView));
}
Aggregations