Search in sources :

Example 1 with NodeQuery

use of org.testfx.service.query.NodeQuery 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 NodeQuery

use of org.testfx.service.query.NodeQuery 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 NodeQuery

use of org.testfx.service.query.NodeQuery in project TestFX by TestFX.

the class FxRobot method pointOfVisibleNode.

private <T extends Node> PointQuery pointOfVisibleNode(Matcher<T> matcher) {
    NodeQuery nodeQuery = lookup(matcher);
    Node node = queryVisibleNode(nodeQuery, "the matcher \"" + matcher.toString() + "\"");
    return point(node);
}
Also used : NodeQuery(org.testfx.service.query.NodeQuery) Node(javafx.scene.Node)

Example 4 with NodeQuery

use of org.testfx.service.query.NodeQuery in project TestFX by TestFX.

the class FxRobot method point.

@Override
public PointQuery point(String query) {
    NodeQuery nodeQuery = lookup(query);
    Node node = queryNode(nodeQuery, "the query \"" + query + "\"");
    return point(node).atPosition(context.getPointPosition());
}
Also used : NodeQuery(org.testfx.service.query.NodeQuery) Node(javafx.scene.Node)

Example 5 with NodeQuery

use of org.testfx.service.query.NodeQuery in project TestFX by TestFX.

the class FxRobot method pointOfVisibleNode.

private <T extends Node> PointQuery pointOfVisibleNode(Predicate<T> predicate) {
    NodeQuery nodeQuery = lookup(predicate);
    Node node = queryVisibleNode(nodeQuery, "the predicate");
    return point(node);
}
Also used : NodeQuery(org.testfx.service.query.NodeQuery) Node(javafx.scene.Node)

Aggregations

NodeQuery (org.testfx.service.query.NodeQuery)16 Node (javafx.scene.Node)8 Test (org.junit.Test)6 NodeFinder (org.testfx.service.finder.NodeFinder)4 ArrayList (java.util.ArrayList)2 Button (javafx.scene.control.Button)2 Cell (javafx.scene.control.Cell)2 TextField (javafx.scene.control.TextField)2 Region (javafx.scene.layout.Region)2 Unstable (org.testfx.api.annotation.Unstable)1