You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Users can easily the Optional values when searching either for a Node or RNode and are forced to interact with the Optional value. Sometimes it might be useful to just fail the test when the expected element is not present.
Consider adding the following convenience methods like the following ones:
protected <T extends Node> T find(final String searchTerm) {
final Optional<RNode<T>> optional = rc().cssFirst(searchTerm);
if (!optional.isPresent()) {
fail("Unable to find Node with search term: '" + searchTerm + "'");
}
return optional.get().node();
}
protected <T extends Node> RNode<T> rNode(final String searchTerm) {
final Optional<RNode<T>> optional = rc().cssFirst(searchTerm);
if (!optional.isPresent()) {
fail("Unable to find RNode with search term: '" + searchTerm + "'");
}
return optional.get();
}
The text was updated successfully, but these errors were encountered:
Users can easily the Optional values when searching either for a Node or RNode and are forced to interact with the Optional value. Sometimes it might be useful to just fail the test when the expected element is not present.
Consider adding the following convenience methods like the following ones:
The text was updated successfully, but these errors were encountered: