Search in sources :

Example 1 with NodeFinder

use of org.testfx.service.finder.NodeFinder in project TestFX by TestFX.

the class ListViewMatchers method hasListCell.

private static boolean hasListCell(ListView listView, Object value) {
    NodeFinder nodeFinder = FxAssert.assertContext().getNodeFinder();
    NodeQuery nodeQuery = nodeFinder.from(listView);
    return nodeQuery.lookup(SELECTOR_LIST_CELL).<Cell>match(cell -> hasCellValue(cell, value)).tryQuery().isPresent();
}
Also used : NodeQuery(org.testfx.service.query.NodeQuery) NodeFinder(org.testfx.service.finder.NodeFinder) Cell(javafx.scene.control.Cell)

Example 2 with NodeFinder

use of org.testfx.service.finder.NodeFinder in project TestFX by TestFX.

the class TableViewMatchers method hasTableCell.

private static boolean hasTableCell(TableView tableView, Object value) {
    NodeFinder nodeFinder = FxAssert.assertContext().getNodeFinder();
    NodeQuery nodeQuery = nodeFinder.from(tableView);
    return nodeQuery.lookup(SELECTOR_TABLE_CELL).<Cell>match(cell -> hasCellValue(cell, value)).tryQuery().isPresent();
}
Also used : NodeQuery(org.testfx.service.query.NodeQuery) NodeFinder(org.testfx.service.finder.NodeFinder) Cell(javafx.scene.control.Cell)

Example 3 with NodeFinder

use of org.testfx.service.finder.NodeFinder in project TestFX by TestFX.

the class NodeMatchers method hasChildren.

private static boolean hasChildren(Node node, int amount, String query) {
    NodeFinder nodeFinder = FxAssert.assertContext().getNodeFinder();
    NodeQuery nodeQuery = nodeFinder.from(node);
    return nodeQuery.lookup(query).queryAll().size() == amount;
}
Also used : NodeQuery(org.testfx.service.query.NodeQuery) NodeFinder(org.testfx.service.finder.NodeFinder)

Example 4 with NodeFinder

use of org.testfx.service.finder.NodeFinder in project TestFX by TestFX.

the class NodeMatchers method hasChild.

private static boolean hasChild(Node node, String query) {
    NodeFinder nodeFinder = FxAssert.assertContext().getNodeFinder();
    NodeQuery nodeQuery = nodeFinder.from(node);
    return !nodeQuery.lookup(query).queryAll().isEmpty();
}
Also used : NodeQuery(org.testfx.service.query.NodeQuery) NodeFinder(org.testfx.service.finder.NodeFinder)

Aggregations

NodeFinder (org.testfx.service.finder.NodeFinder)4 NodeQuery (org.testfx.service.query.NodeQuery)4 Cell (javafx.scene.control.Cell)2