public class Settings extends Object
AssertJ-Swing configuration settings. There are two kinds of configuration entries, writable and only readable entries.
The read-only entries have hard-coded defaults which may be overwritten by assertj-swing.properties
,
which may be overwritten by system properties. See the javadoc of each method to find out the key which is identical
in the properties file and as system property. You can identify read-only properties by the static methods in this
class.
The writable entries are not static but depend on the Settings
object which is created in BasicRobot
and can be accessed through the robot instance. The initialisation is the same as for read-only properties, but you
may change the value at runtime calling the setter methods.
Constructor and Description |
---|
Settings() |
Modifier and Type | Method and Description |
---|---|
boolean |
clickOnDisabledComponentsAllowed() |
void |
clickOnDisabledComponentsAllowed(boolean allow)
Default is
true . |
ComponentLookupScope |
componentLookupScope() |
void |
componentLookupScope(ComponentLookupScope scope)
Updates the scope of AWT or Swing
Component lookups. |
int |
delayBetweenEvents() |
void |
delayBetweenEvents(int ms)
Updates the value representing the millisecond count in between generated events.
|
MouseButton |
dragButton() |
void |
dragButton(MouseButton button)
Changes the
MouseButton to use for drag operations. |
int |
dragDelay() |
void |
dragDelay(int ms)
Updates the number of milliseconds to wait between a pressing a mouse button and moving the mouse.
|
int |
dropDelay() |
void |
dropDelay(int ms)
Updates the number of milliseconds between the final mouse movement and mouse release to ensure drop ends.
|
int |
eventPostingDelay() |
void |
eventPostingDelay(int ms)
Updates the number of milliseconds before checking for idle.
|
int |
idleTimeout() |
void |
idleTimeout(int ms)
Updates the time (in milliseconds) to wait for an idle AWT event queue.
|
static boolean |
shouldPreserveScreenshots() |
boolean |
simpleWaitForIdle() |
void |
simpleWaitForIdle(boolean simpleWaitForIdle)
turns on or off the simple waitForIdle implementation
|
int |
timeoutToBeVisible() |
void |
timeoutToBeVisible(int ms)
Updates the number of milliseconds to wait for an AWT or Swing
Component to be visible. |
int |
timeoutToFindPopup() |
void |
timeoutToFindPopup(int ms)
Updates the number of milliseconds to wait before failing to find a pop-up menu that should appear.
|
int |
timeoutToFindSubMenu() |
void |
timeoutToFindSubMenu(int ms)
Updates the number of milliseconds to wait for a sub-menu to appear.
|
public static boolean shouldPreserveScreenshots()
public int delayBetweenEvents()
for default value and configuration key
public void delayBetweenEvents(int ms)
The property key for configuration file and system properties is
org.assertj.swing.delay.between_events
To change the speed of a GUI test, you need to change the values of both delayBetweenEvents
and
eventPostingDelay
.
ms
- the millisecond count in between generated events. It should be between -1 and 60000.eventPostingDelay(int)
public int timeoutToBeVisible()
Component
to be visible.for default value and configuration key
public void timeoutToBeVisible(int ms)
Component
to be visible. The default value
is 30,000 milliseconds.
The property key for configuration file and system properties is org.assertj.swing.timeout.visibility
ms
- the time in milliseconds. It should be between 0 and 60000.public int timeoutToFindPopup()
for default value and configuration key
public void timeoutToFindPopup(int ms)
The property key for configuration file and system properties is org.assertj.swing.timeout.popup
ms
- the time in milliseconds. It should be between 0 and 60000.public int timeoutToFindSubMenu()
for default value and configuration key
public void timeoutToFindSubMenu(int ms)
The property key for configuration file and system properties is org.assertj.swing.timeout.submenu
ms
- the time in milliseconds. It should be between 0 and 10000.public int dragDelay()
for default value and configuration key
public void dragDelay(int ms)
The property key for configuration file and system properties is org.assertj.swing.delay.drag
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.public int eventPostingDelay()
for default value and configuration key
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.
The property key for configuration file and system properties is
org.assertj.swing.delay.posting_events
To change the speed of a GUI test, you need to change the values of both delayBetweenEvents
and
eventPostingDelay
.
ms
- the time in milliseconds. It should be between 0 and 1000.delayBetweenEvents(int)
public int dropDelay()
for default value and configuration key
public void dropDelay(int ms)
The property key for configuration file and system properties is org.assertj.swing.delay.drop
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.@Nonnull public ComponentLookupScope componentLookupScope()
Component
lookups. This setting only affects the classes in the package
org.assertj.swing.fixture
.for default value and configuration key
public void componentLookupScope(@Nonnull ComponentLookupScope scope)
Component
lookups. This setting only affects the classes in the package
org.assertj.swing.fixture
. The default value is ComponentLookupScope.DEFAULT
.
The property key for configuration file and system properties is org.assertj.swing.lookup_scope
scope
- the new value for the scope.public int idleTimeout()
for default value and configuration key
public void idleTimeout(int ms)
The property key for configuration file and system properties is org.assertj.swing.timeout.idle
ms
- the new time. The value should be equal to or greater than zero.public boolean simpleWaitForIdle()
public void simpleWaitForIdle(boolean simpleWaitForIdle)
simpleWaitForIdle
- true
if simple implementation should be usedpublic boolean clickOnDisabledComponentsAllowed()
true
if clicking on disabled components should be possible.for default value and configuration key
public void clickOnDisabledComponentsAllowed(boolean allow)
true
.
The property key for configuration file and system properties is
org.assertj.swing.allow_click_on_disabled_component
.
allow
- new value for clickOnDisabledComponentsAllowed(boolean)
.public MouseButton dragButton()
MouseButton
to use for drag operations.for default value and configuration key
public void dragButton(MouseButton button)
MouseButton
to use for drag operations. Default is MouseButton.LEFT_BUTTON
.
The property key for configuration file and system properties is org.assertj.swing.drag.button
button
- the MouseButton
to use from now onCopyright © 2014–2020 AssertJ. All rights reserved.