public class AbstractButtonDriver extends JComponentDriver implements TextDisplayDriver<AbstractButton>
AbstractButton
s:
org.fest.swing.fixture
in your tests.robot
Constructor and Description |
---|
AbstractButtonDriver(Robot robot)
Creates a new
AbstractButtonDriver . |
Modifier and Type | Method and Description |
---|---|
void |
requireNotSelected(AbstractButton button)
Verifies that the button is not selected.
|
void |
requireSelected(AbstractButton button)
Verifies that the button is selected.
|
void |
requireText(AbstractButton button,
Pattern pattern)
Asserts that the text in the given button matches the given regular expression pattern.
|
void |
requireText(AbstractButton button,
String expected)
Asserts that the text in the given button is equal to or matches the specified
String . |
void |
select(AbstractButton button)
Selects the given button only it is not already selected.
|
String |
textOf(AbstractButton button)
Returns the text of the given button.
|
void |
unselect(AbstractButton button)
Unselects the given button only if it is selected.
|
clientProperty, invokeAction, isVisible, isVisible, requireToolTip, requireToolTip, scrollToVisible
move, resize, resizeHeight, resizeWidth
assertIsEnabledAndShowing, click, click, click, click, click, doubleClick, drag, dragOver, drop, focus, focusAndWaitForFocusGain, invokePopupMenu, invokePopupMenu, moveMouseIgnoringAnyError, moveMouseIgnoringAnyError, performAccessibleActionOf, pressAndReleaseKey, pressAndReleaseKey, pressAndReleaseKeys, pressKey, propertyName, releaseKey, requireDisabled, requireEnabled, requireEnabled, requireFocused, requireNotVisible, requireSize, requireVisible, rightClick, settings, waitForShowing
public AbstractButtonDriver(Robot robot)
AbstractButtonDriver
.robot
- the robot to use to simulate user input.@RunsInEDT public void requireText(AbstractButton button, String expected)
String
.requireText
in interface TextDisplayDriver<AbstractButton>
button
- the given button.expected
- the text to match. It can be a regular expression.AssertionError
- if the text of the button is not equal to or does not match the given one.public void requireText(AbstractButton button, Pattern pattern)
requireText
in interface TextDisplayDriver<AbstractButton>
button
- the given button.pattern
- the regular expression pattern to match.NullPointerException
- if the given regular expression pattern is null
.AssertionError
- if the text of the button does not match the given regular expression pattern.@RunsInEDT public String textOf(AbstractButton button)
textOf
in interface TextDisplayDriver<AbstractButton>
button
- the given button.@RunsInEDT public void select(AbstractButton button)
button
- the target button.IllegalStateException
- if the button is disabled.IllegalStateException
- if the button is not showing on the screen.@RunsInEDT public void unselect(AbstractButton button)
button
- the target button.IllegalStateException
- if the button is disabled.IllegalStateException
- if the button is not showing on the screen.@RunsInEDT public void requireSelected(AbstractButton button)
button
- the given button.AssertionError
- if the button is not selected.@RunsInEDT public void requireNotSelected(AbstractButton button)
button
- the given button.AssertionError
- if the button is selected.Copyright © 2007-2013 FEST (Fixtures for Easy Software Testing). All Rights Reserved.