public abstract class GuiTest extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
GuiTest.TestFxApp |
| Modifier and Type | Field and Description |
|---|---|
protected static javafx.stage.Stage |
stage |
| Constructor and Description |
|---|
GuiTest() |
| Modifier and Type | Method and Description |
|---|---|
static File |
captureScreenshot() |
GuiTest |
click(javafx.geometry.Bounds bounds,
javafx.scene.input.MouseButton... buttons) |
GuiTest |
click(org.loadui.testfx.GuiTest.OffsetTarget target,
javafx.scene.input.MouseButton... buttons) |
GuiTest |
click(Iterable<?> iterable,
javafx.scene.input.MouseButton... buttons) |
GuiTest |
click(org.hamcrest.Matcher<javafx.scene.Node> matcher,
javafx.scene.input.MouseButton... buttons) |
GuiTest |
click(javafx.scene.input.MouseButton... buttons) |
GuiTest |
click(javafx.scene.Node node,
javafx.scene.input.MouseButton... buttons) |
GuiTest |
click(javafx.geometry.Point2D point,
javafx.scene.input.MouseButton... buttons) |
<T extends javafx.scene.Node> |
click(com.google.common.base.Predicate<T> p,
javafx.scene.input.MouseButton... buttons) |
GuiTest |
click(javafx.scene.Scene scene,
javafx.scene.input.MouseButton... buttons) |
GuiTest |
click(String query,
javafx.scene.input.MouseButton... buttons)
Clicks the first Node matching the given query.
|
GuiTest |
click(javafx.stage.Window window,
javafx.scene.input.MouseButton... buttons) |
GuiTest |
closeCurrentWindow()
Closes the front-most window using the Alt+F4 keyboard shortcut.
|
GuiTest |
doubleClick() |
GuiTest |
doubleClick(javafx.geometry.Bounds bounds) |
GuiTest |
doubleClick(org.loadui.testfx.GuiTest.OffsetTarget target) |
GuiTest |
doubleClick(Iterable<?> iterable) |
GuiTest |
doubleClick(org.hamcrest.Matcher<javafx.scene.Node> matcher) |
GuiTest |
doubleClick(javafx.scene.input.MouseButton button) |
GuiTest |
doubleClick(javafx.scene.Node node) |
GuiTest |
doubleClick(javafx.geometry.Point2D point) |
<T extends javafx.scene.Node> |
doubleClick(com.google.common.base.Predicate<T> predicate) |
GuiTest |
doubleClick(javafx.scene.Scene scene) |
GuiTest |
doubleClick(String query)
Double-clicks a given target.
|
GuiTest |
doubleClick(javafx.stage.Window window) |
MouseMotion |
drag(Object source,
javafx.scene.input.MouseButton... buttons) |
GuiTest |
eraseCharacters(int characters) |
static boolean |
exists(String query) |
static <T extends javafx.scene.Node> |
find(org.hamcrest.Matcher<Object> matcher) |
static <T extends javafx.scene.Node> |
find(com.google.common.base.Predicate<T> predicate) |
static <T extends javafx.scene.Node> |
find(String query) |
static <T extends javafx.scene.Node> |
find(String selector,
Object parent) |
static Set<javafx.scene.Node> |
findAll(org.hamcrest.Matcher<Object> matcher,
javafx.scene.Node parent)
Returns all child nodes of parent, that matches the given matcher.
|
static <T extends javafx.scene.Node> |
findAll(com.google.common.base.Predicate<T> predicate,
javafx.scene.Node parent) |
static Set<javafx.scene.Node> |
findAll(String query) |
static javafx.stage.Stage |
findStageByTitle(String titleRegex) |
protected abstract javafx.scene.Parent |
getRootNode() |
static javafx.stage.Window |
getWindowByIndex(int index) |
static List<javafx.stage.Window> |
getWindows() |
GuiTest |
move(double x,
double y)
Moves the mouse cursor to the given coordinates.
|
GuiTest |
move(Object target) |
GuiTest |
moveBy(double x,
double y)
Moves the mouse cursor relatively to its current position.
|
static Callable<Integer> |
numberOf(String nodeQuery)
Returns a Callable that calculates the number of nodes that matches the given query.
|
static org.loadui.testfx.GuiTest.OffsetTarget |
offset(Object target,
double offsetX,
double offsetY) |
javafx.geometry.Point2D |
pointFor(Object target) |
GuiTest |
pos(javafx.geometry.Pos pos) |
GuiTest |
press(javafx.scene.input.KeyCode... keys)
Presses and holds a given key, until explicitly released.
|
GuiTest |
press(javafx.scene.input.MouseButton... buttons)
Presses and holds a mouse button, until explicitly released.
|
GuiTest |
push(char character)
Alias for type().
|
GuiTest |
push(javafx.scene.input.KeyCode... keys)
Alias for type( ).
|
GuiTest |
release(javafx.scene.input.KeyCode... keys)
Releases a given key.
|
GuiTest |
release(javafx.scene.input.MouseButton... buttons)
Releases a pressed mouse button.
|
GuiTest |
rightClick() |
GuiTest |
rightClick(javafx.geometry.Bounds bounds) |
GuiTest |
rightClick(org.loadui.testfx.GuiTest.OffsetTarget target) |
GuiTest |
rightClick(Iterable<?> iterable) |
GuiTest |
rightClick(org.hamcrest.Matcher<javafx.scene.Node> matcher) |
GuiTest |
rightClick(javafx.scene.Node node) |
GuiTest |
rightClick(javafx.geometry.Point2D point) |
<T extends javafx.scene.Node> |
rightClick(com.google.common.base.Predicate<T> predicate) |
GuiTest |
rightClick(javafx.scene.Scene scene) |
GuiTest |
rightClick(String query)
Right-clicks a given target.
|
GuiTest |
rightClick(javafx.stage.Window window) |
GuiTest |
scroll(int amount)
Deprecated.
|
GuiTest |
scroll(int amount,
javafx.geometry.VerticalDirection direction)
Scrolls the mouse-wheel a given number of notches in a direction.
|
GuiTest |
scroll(javafx.geometry.VerticalDirection direction)
Scrolls the mouse-wheel one notch in the given direction.
|
void |
setupStage() |
GuiTest |
sleep(long ms)
Same as Thread.sleep(), but without checked exceptions.
|
GuiTest |
sleep(long value,
TimeUnit unit) |
GuiTest |
target(Object window) |
static <T extends javafx.stage.Window> |
targetWindow(T window) |
GuiTest |
type(char character) |
GuiTest |
type(javafx.scene.input.KeyCode... keys) |
GuiTest |
type(String text)
Types the given text on the keyboard.
|
static <T> void |
waitUntil(Callable<T> callable,
org.hamcrest.Matcher<? super T> condition) |
static void |
waitUntil(javafx.scene.Node node,
org.hamcrest.Matcher<Object> condition)
Waits until the provided node fulfills the given condition.
|
static void |
waitUntil(javafx.scene.Node node,
org.hamcrest.Matcher<Object> condition,
int timeoutInSeconds) |
static <T> void |
waitUntil(T value,
org.hamcrest.Matcher<? super T> condition) |
static <T> void |
waitUntil(T value,
org.hamcrest.Matcher<? super T> condition,
int timeoutInSeconds) |
static <T extends javafx.scene.Node> |
waitUntil(T node,
com.google.common.base.Predicate<T> condition) |
static <T extends javafx.scene.Node> |
waitUntil(T node,
com.google.common.base.Predicate<T> condition,
int timeoutInSeconds) |
protected abstract javafx.scene.Parent getRootNode()
public static <T extends javafx.stage.Window> T targetWindow(T window)
public static org.loadui.testfx.GuiTest.OffsetTarget offset(Object target, double offsetX, double offsetY)
public static List<javafx.stage.Window> getWindows()
public static javafx.stage.Window getWindowByIndex(int index)
public static javafx.stage.Stage findStageByTitle(String titleRegex)
public static <T extends javafx.scene.Node> T find(String query)
public static boolean exists(String query)
public static Callable<Integer> numberOf(String nodeQuery)
nodeQuery - a CSS query or the label of a node.public static File captureScreenshot()
public static void waitUntil(javafx.scene.Node node,
org.hamcrest.Matcher<Object> condition,
int timeoutInSeconds)
public static void waitUntil(javafx.scene.Node node,
org.hamcrest.Matcher<Object> condition)
node - condition - public static <T> void waitUntil(T value,
org.hamcrest.Matcher<? super T> condition)
public static <T> void waitUntil(Callable<T> callable, org.hamcrest.Matcher<? super T> condition)
public static <T> void waitUntil(T value,
org.hamcrest.Matcher<? super T> condition,
int timeoutInSeconds)
public static <T extends javafx.scene.Node> void waitUntil(T node,
com.google.common.base.Predicate<T> condition)
public static <T extends javafx.scene.Node> void waitUntil(T node,
com.google.common.base.Predicate<T> condition,
int timeoutInSeconds)
public static <T extends javafx.scene.Node> T find(org.hamcrest.Matcher<Object> matcher)
public static <T extends javafx.scene.Node> T find(com.google.common.base.Predicate<T> predicate)
public static Set<javafx.scene.Node> findAll(org.hamcrest.Matcher<Object> matcher, javafx.scene.Node parent)
matcher - parent - public static <T extends javafx.scene.Node> Set<T> findAll(com.google.common.base.Predicate<T> predicate, javafx.scene.Node parent)
public GuiTest sleep(long ms)
ms - time in millisecondspublic GuiTest click(javafx.scene.input.MouseButton... buttons)
public GuiTest click(String query, javafx.scene.input.MouseButton... buttons)
query - either CSS selector, label of node or class name.buttons - public GuiTest click(javafx.scene.Node node, javafx.scene.input.MouseButton... buttons)
public <T extends javafx.scene.Node> GuiTest click(com.google.common.base.Predicate<T> p, javafx.scene.input.MouseButton... buttons)
public GuiTest click(javafx.geometry.Point2D point, javafx.scene.input.MouseButton... buttons)
public GuiTest click(javafx.geometry.Bounds bounds, javafx.scene.input.MouseButton... buttons)
public GuiTest click(javafx.scene.Scene scene, javafx.scene.input.MouseButton... buttons)
public GuiTest click(javafx.stage.Window window, javafx.scene.input.MouseButton... buttons)
public GuiTest click(org.hamcrest.Matcher<javafx.scene.Node> matcher, javafx.scene.input.MouseButton... buttons)
public GuiTest click(org.loadui.testfx.GuiTest.OffsetTarget target, javafx.scene.input.MouseButton... buttons)
public GuiTest rightClick()
public GuiTest rightClick(javafx.scene.Node node)
public GuiTest rightClick(org.hamcrest.Matcher<javafx.scene.Node> matcher)
public <T extends javafx.scene.Node> GuiTest rightClick(com.google.common.base.Predicate<T> predicate)
public GuiTest rightClick(javafx.scene.Scene scene)
public GuiTest rightClick(javafx.stage.Window window)
public GuiTest rightClick(javafx.geometry.Point2D point)
public GuiTest rightClick(javafx.geometry.Bounds bounds)
public GuiTest rightClick(org.loadui.testfx.GuiTest.OffsetTarget target)
public GuiTest doubleClick()
public GuiTest doubleClick(String query)
query - public GuiTest doubleClick(javafx.scene.Node node)
public GuiTest doubleClick(org.hamcrest.Matcher<javafx.scene.Node> matcher)
public <T extends javafx.scene.Node> GuiTest doubleClick(com.google.common.base.Predicate<T> predicate)
public GuiTest doubleClick(javafx.scene.Scene scene)
public GuiTest doubleClick(javafx.stage.Window window)
public GuiTest doubleClick(javafx.geometry.Point2D point)
public GuiTest doubleClick(javafx.geometry.Bounds bounds)
public GuiTest doubleClick(org.loadui.testfx.GuiTest.OffsetTarget target)
public GuiTest doubleClick(javafx.scene.input.MouseButton button)
public GuiTest eraseCharacters(int characters)
public MouseMotion drag(Object source, javafx.scene.input.MouseButton... buttons)
public GuiTest move(double x, double y)
x - y - public GuiTest moveBy(double x, double y)
x - y - public GuiTest press(javafx.scene.input.MouseButton... buttons)
buttons - defaults to the primary mouse button.public GuiTest release(javafx.scene.input.MouseButton... buttons)
buttons - defaults to the primary mouse button.@Deprecated public GuiTest scroll(int amount)
public GuiTest scroll(int amount, javafx.geometry.VerticalDirection direction)
amount - the number of notches to scrolldirection - public GuiTest scroll(javafx.geometry.VerticalDirection direction)
direction - public GuiTest type(String text)
text - public GuiTest type(char character)
public GuiTest push(javafx.scene.input.KeyCode... keys)
keys - public GuiTest push(char character)
character - public GuiTest type(javafx.scene.input.KeyCode... keys)
public GuiTest press(javafx.scene.input.KeyCode... keys)
keys - public GuiTest release(javafx.scene.input.KeyCode... keys)
keys - public GuiTest pos(javafx.geometry.Pos pos)
public GuiTest closeCurrentWindow()
public javafx.geometry.Point2D pointFor(Object target)
Copyright © 2014. All rights reserved.