Package org.fest.swing.core
Class Settings
java.lang.Object
org.fest.swing.core.Settings
Understands configuration settings.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ComponentLookupScope
private static final int
private int
private int
private int
private int
private int
private Robot
private int
private int
private int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void
Returns the scope of component lookups.void
Updates the scope of component lookups.int
Returns a value representing the millisecond count in between generated events.void
delayBetweenEvents
(int ms) Updates the value representing the millisecond count in between generated events.int
Returns the number of milliseconds to wait between a pressing a mouse button and moving the mouse.void
dragDelay
(int ms) Updates the number of milliseconds to wait between a pressing a mouse button and moving the mouse.int
Returns the number of milliseconds between the final mouse movement and mouse release to ensure drop ends.void
dropDelay
(int ms) Updates the number of milliseconds between the final mouse movement and mouse release to ensure drop ends.int
Returns the number of milliseconds before checking for idle.void
eventPostingDelay
(int ms) Updates the number of milliseconds before checking for idle.int
Returns the time (in milliseconds) to wait for an idle AWT event queue.void
idleTimeout
(int ms) Updates the time (in milliseconds) to wait for an idle AWT event queue.(package private) Robot
robot()
int
Returns the number of milliseconds to wait for a component to be visible.void
timeoutToBeVisible
(int ms) Updates the number of milliseconds to wait for a component to be visible.int
Returns the number of milliseconds to wait before failing to find a pop-up menu that should appear.void
timeoutToFindPopup
(int ms) Updates the number of milliseconds to wait before failing to find a pop-up menu that should appear.int
Returns the number of milliseconds to wait for a sub-menu to appear.void
timeoutToFindSubMenu
(int ms) Updates the number of milliseconds to wait for a sub-menu to appear.private void
private int
valueToUpdate
(int value, int min, int max)
-
Field Details
-
DEFAULT_DELAY
private static final int DEFAULT_DELAY- See Also:
-
componentLookupScope
-
timeoutToBeVisible
private int timeoutToBeVisible -
timeoutToFindPopup
private int timeoutToFindPopup -
timeoutToFindSubMenu
private int timeoutToFindSubMenu -
delayBetweenEvents
private int delayBetweenEvents -
dragDelay
private int dragDelay -
dropDelay
private int dropDelay -
eventPostingDelay
private int eventPostingDelay -
idleTimeout
private int idleTimeout -
robot
-
-
Constructor Details
-
Settings
public Settings()
-
-
Method Details
-
attachTo
-
robot
Robot robot() -
delayBetweenEvents
public int delayBetweenEvents()Returns a value representing the millisecond count in between generated events. The default is 60 milliseconds.- Returns:
- a value representing the millisecond count in between generated events.
-
delayBetweenEvents
public void delayBetweenEvents(int ms) Updates the value representing the millisecond count in between generated events. Usually just set to 100-200 if you want to slow down the playback to simulate actual user input. The default is 60 milliseconds.To change the speed of a GUI test, you need to change the values of both
delayBetweenEvents
andeventPostingDelay
.- Parameters:
ms
- the millisecond count in between generated events. It should be between -1 and 60000.- See Also:
-
updateRobotAutoDelay
private void updateRobotAutoDelay() -
timeoutToBeVisible
public int timeoutToBeVisible()Returns the number of milliseconds to wait for a component to be visible. The default value is 30000 milliseconds.- Returns:
- the number of milliseconds to wait for a component to be visible.
-
timeoutToBeVisible
public void timeoutToBeVisible(int ms) Updates the number of milliseconds to wait for a component to be visible. The default value is 30000 milliseconds.- Parameters:
ms
- the time in milliseconds. It should be between 0 and 60000.
-
timeoutToFindPopup
public int timeoutToFindPopup()Returns the number of milliseconds to wait before failing to find a pop-up menu that should appear. The default value is 30000 milliseconds.- Returns:
- the number of milliseconds to wait before failing to find a pop-up menu that should appear.
-
timeoutToFindPopup
public void timeoutToFindPopup(int ms) Updates the number of milliseconds to wait before failing to find a pop-up menu that should appear. The default value is 30000 milliseconds.- Parameters:
ms
- the time in milliseconds. It should be between 0 and 60000.
-
timeoutToFindSubMenu
public int timeoutToFindSubMenu()Returns the number of milliseconds to wait for a sub-menu to appear. The default value is 100 milliseconds.- Returns:
- the number of milliseconds to wait for a sub-menu to appear.
- Since:
- 1.2
-
timeoutToFindSubMenu
public void timeoutToFindSubMenu(int ms) Updates the number of milliseconds to wait for a sub-menu to appear. The default value is 100 milliseconds.- Parameters:
ms
- the time in milliseconds. It should be between 0 and 10000.- Since:
- 1.2
-
dragDelay
public int dragDelay()Returns the number of milliseconds to wait between a pressing a mouse button and moving the mouse. The default value for Mac OS X or the X11 Windowing system is 100 milliseconds. For other platforms, the default value is 0.- Returns:
- the number of milliseconds to wait between a pressing a mouse button and moving the mouse.
-
dragDelay
public void dragDelay(int ms) Updates the number of milliseconds to wait between a pressing a mouse button and moving the mouse. The default value for Mac OS X or the X11 Windowing system is 100 milliseconds. For other platforms, the default value is 0.- Parameters:
ms
- the time in milliseconds. For Mac OS X or the X11 Windowing system, the minimum value is 100. For other platforms the minimum value is 0. The maximum value for all platforms is 60000.
-
eventPostingDelay
public int eventPostingDelay()Returns the number of milliseconds before checking for idle. The default value is 100 milliseconds.- Returns:
- the number of milliseconds before checking for idle.
-
eventPostingDelay
public void eventPostingDelay(int ms) Updates the number of milliseconds before checking for idle. This allows the system a little time to put a native event onto the AWT event queue. The default value is 100 milliseconds.To change the speed of a GUI test, you need to change the values of both
delayBetweenEvents
andeventPostingDelay
.- Parameters:
ms
- the time in milliseconds. It should be between 0 and 1000.- See Also:
-
dropDelay
public int dropDelay()Returns the number of milliseconds between the final mouse movement and mouse release to ensure drop ends. The default value for Windows is 200. For other platforms, the default value is 0.- Returns:
- the number of milliseconds between the final mouse movement and mouse release to ensure drop ends.
-
dropDelay
public void dropDelay(int ms) Updates the number of milliseconds between the final mouse movement and mouse release to ensure drop ends. The default value for Windows is 200. For other platforms, the default value is 0.- Parameters:
ms
- the time in milliseconds. For Windows, the minimum value is 200. For other platforms, the minimum value is 0. The maximum value for all platforms is 60000.
-
componentLookupScope
Returns the scope of component lookups. This setting only affects the component fixtures in the packageorg.fest.swing.fixture
. The default value is
.ComponentLookupScope.DEFAULT
- Returns:
- the scope of component lookups.
-
componentLookupScope
Updates the scope of component lookups. This setting only affects the component fixtures in the packageorg.fest.swing.fixture
. The default value is
.ComponentLookupScope.DEFAULT
- Parameters:
scope
- the new value for the scope.
-
idleTimeout
public int idleTimeout()Returns the time (in milliseconds) to wait for an idle AWT event queue. The default value is 10000 milliseconds.- Returns:
- the time (in milliseconds) to wait for an idle AWT event queue.
-
idleTimeout
public void idleTimeout(int ms) Updates the time (in milliseconds) to wait for an idle AWT event queue.- Parameters:
ms
- the new time. The value should be equal to or greater than zero.
-
valueToUpdate
private int valueToUpdate(int value, int min, int max)
-