-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(refactor) Service: Enhance the functionality of the services. #167
Comments
This was referenced Dec 1, 2014
clickOn(".button");
verifyThat(".button", isEnabled()); // Matcher<Node>
verifyThat(".button", hasItem(isEnabled()); // Matcher<Iterable<Node>>
verifyThat(".button", everyItem(isEnabled()); // Matcher<Iterable<Node>> // FxRobot:
void clickOn(String selector) { // pointFor(String selector)
// queryFirst() throws a NodeQueryException that gives the matcher's descriptions
// and states how many items were matched by them. If throwIfEmpty() was omitted
// then queryFirst().get() will throw an IllegalStateException.
NodeQuery nodeQuery = nodeFinder()
.from(rootsOfWindows(windowFinder().allWindows()))
.lookup(bySelector(selector))
.match(isVisible());
clickOn(nodeQuery.throwIfEmpty().queryFirst().get());
}
// FxRobot:
void clickOn(String selector) {
NodeQuery nodeQuery = nodeFinder().node()
.from(rootsOfWindows(windowFinder().allWindows()))
.lookup(bySelector(selector));
// if (visibleNodeQuery.queryAll().isEmpty()) { throw new FxRobotException()) }
NodeQuery visibleNodeQuery = nodeFinder().node()
.from(nodeQuery.queryAll())
.match(isVisible());
clickOn(visibleNodeQuery.queryFirst().get());
}
// FxAssert:
void verifyThat(String selector, Matcher<Node> matcher) {
// queryFirst().orNull() does not throw an Exception, since throwIfEmpty() was
// omitted. verifyThat() throws an AssertionError and uses matcher for description.
NodeQuery nodeQuery = nodeFinder()
.from(rootsOfWindows(windowFinder().allWindows()))
.lookup(bySelector(selector));
verifyThat(nodeQuery.queryFirst().orNull(), matcher);
}
// FxAssert:
void verifyThat(String selector, Matcher<Iterable<Node>> matcher) {
NodeQuery nodeQuery = nodeFinder()
.from(rootsOfWindows(windowFinder().allWindows()))
.lookup(bySelector(selector));
verifyThat(nodeQuery.queryAll(), matcher);
} TODO: Create screenshots and add a note to the matcher descriptions. query().from(verifyThatNode).queryFirst();
query().from(rootOfPopupControl(popupControl))
.lookup(bySelector(".color-square"))
.match(isColorSquareWith(Color.RED)) // NoNodesFoundException?
.match(isVisible()) // NoNodesVisibleException?
.queryFirst();
query().from(tableView)
.lookupAt(rowIndex, bySelector(".table-row-cell"))
.lookupAt(columnIndex, bySelector(".table-cell"))
.match(isVisible())
.queryFirst();
Reference: http://en.wikipedia.org/wiki/Monotonicity_of_entailment |
|
hastebrot
changed the title
refactor(Service): Enhance the functionality of the services.
(refactor) Service: Enhance the functionality of the services.
Mar 9, 2015
This was referenced Dec 4, 2015
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
finder.NodeFinder
needs to be able to return invisibleNode
s. Introducing aNodeQuery
could help to keep the interface simple ((feat) Service: Implement NodeQuery. #174, (refactor) Service: MakeNodeFinder
more familiar to JavaFX developers. #205).finder.WindowFinder
needs to be able to acceptNode
s intarget()
andwindow()
((refactor) Rename window methods totargetWindow()
,listWindows()
, andwindow()
. #238).locator.PointLocator
needs to be able to return coordinates relative to theScene
and theScreen
((refactor) API: Rename pointFor() to point() and add pointOfVisibleNode(). #194, (refactor) Service: IntroduceBoundsQuery
and refactorPointQuery
. #206).support.CaptureSupport
needs to be able to capture certainBounds
, drawRectangle
s into theImage
s and add text ofAssertionError
to theImage
s.support.WaitUntilSupport
needs to be able to useWaitForAsyncUtils
instead of the deprecatedFXTestUtils
.The text was updated successfully, but these errors were encountered: