use of org.testfx.service.query.NodeQuery 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;
}
use of org.testfx.service.query.NodeQuery 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();
}
use of org.testfx.service.query.NodeQuery in project TestFX by TestFX.
the class NodeAndPointQueryTest method node_queryAll_returns_empty_set.
@Test
public void node_queryAll_returns_empty_set() {
// when:
NodeQuery query = fx.lookup(".missing");
// then:
assertThat(query.queryAll(), is(Collections.unmodifiableSet(new HashSet<>())));
}
use of org.testfx.service.query.NodeQuery in project TestFX by TestFX.
the class NodeAndPointQueryTest method node_queryFirst_returns_null.
@Test
public void node_queryFirst_returns_null() {
// when:
NodeQuery query = fx.lookup(".missing");
// then:
assertThat(query.query(), nullValue());
}
use of org.testfx.service.query.NodeQuery in project TestFX by TestFX.
the class NodeAndPointQueryTest method node_queryFirst_returns_node.
@Test
public void node_queryFirst_returns_node() {
// when:
NodeQuery query = fx.lookup(".button");
// then:
assertThat(query.query(), is(button0));
}
Aggregations