See: Description
Interface | Description |
---|---|
ClientPropertyStorageFixture |
Understands retrieval of client properties from GUI components.
|
CommonComponentFixture |
Understands
simulation of keyboard focus
simulation of keyboard input
simulation of mouse input
state verification
of a GUI component.
|
ComponentContainerFixture | |
EditableComponentFixture |
Understands state verification of an editable GUI component.
|
FocusableComponentFixture |
Understands simulation of input focus on a GUI component.
|
FrameLikeFixture |
Understands functional testing of frame-like components (not necessarily subclasses of
):
user input simulation
state verification
property value query
|
ItemFixture |
Understands functional testing of GUI component items (e.g.
|
ItemGroupFixture | |
JComponentFixture |
Understands functional testing of
s:
user input simulation
state verification
property value query
|
JPopupMenuInvokerFixture |
Understands input simulation on
s capable of invoking
s. |
JTreeNodeFixture |
Understands functional testing of single nodes in
s:
user input simulation
state verification
property value query
|
KeyboardInputSimulationFixture |
Understands simulation of keyboard input on a GUI component.
|
MouseInputSimulationFixture |
Understands simulation of mouse input on a GUI component.
|
StateVerificationFixture |
Understands state verification of a GUI component.
|
TextDisplayFixture |
Understands state verification and property value queries of GUI components that display text.
|
TextInputFixture |
Understands simulation of user events on GUI components that accept text input from the user.
|
ToolTipDisplayFixture |
Understands state verification of GUI components that display a tool-tip.
|
TwoStateButtonFixture |
Understands state verification of "two-state" buttons.
|
WindowLikeContainerFixture |
Understands functional testing of window-like containers (not necessarily subclasses of
):
user input simulation
state verification
property value query
|
Class | Description |
---|---|
ColorFixture |
Understands state verification of
s. |
ComponentFixture<T extends Component> |
Understands functional testing of
s:
user input simulation
state verification
property value query
|
ComponentFixtureExtension<C extends Component,F extends ComponentFixture<C>> |
Understands an "extension method" for implementations of
. |
ComponentFixtureValidator |
Understands a validator of common objects used in component fixtures.
|
ContainerFixture<T extends Container> | |
Containers |
Understands utility methods related to
s. |
DialogFixture |
Understands functional testing of
s:
user input simulation
state verification
property value query
|
FontFixture |
Understands state verification of
s. |
FrameFixture |
Understands functional testing of
s:
user input simulation
state verification
property value query
|
GenericComponentFixture<T extends Component> |
A generic component fixture providing basic keyboard and mouse input operations.
|
JButtonFixture |
Understands functional testing of
s:
user input simulation
state verification
property value query
|
JCheckBoxFixture |
Understands functional testing of
es:
user input simulation
state verification
property value query
|
JComboBoxFixture |
Understands functional testing of
es:
user input simulation
state verification
property value query
|
JFileChooserFixture |
Understands functional testing of
s:
user input simulation
state verification
property value query
|
JInternalFrameFixture |
Understands functional testing of
s:
user input simulation
state verification
property value query
|
JLabelFixture |
Understands functional testing of
s:
user input simulation
state verification
property value query
|
JListFixture |
Understands functional testing of
s:
user input simulation
state verification
property value query
|
JListItemFixture |
Understands functional testing of single rows in
s:
user input simulation
state verification
property value query
|
JMenuItemFixture |
Understands functional testing of
s:
user input simulation
state verification
property value query
|
JOptionPaneFixture |
Understands functional testing of
s:
user input simulation
state verification
property value query
|
JPanelFixture |
Understands functional testing of
s:
user input simulation
state verification
property value query
|
JPopupMenuFixture |
Understands functional testing of
s:
user input simulation
state verification
property value query
|
JProgressBarFixture |
Understands functional testing of
s:
state verification
property value query
|
JRadioButtonFixture |
Understands functional testing of
s:
user input simulation
state verification
property value query
|
JScrollBarFixture |
Understands functional testing of
s:
user input simulation
state verification
property value query
|
JScrollPaneFixture |
Understands functional testing of
s:
user input simulation
state verification
property value query
|
JSliderFixture |
Understands functional testing of
s:
user input simulation
state verification
property value query
|
JSpinnerFixture |
Understands functional testing of
s:
user input simulation
state verification
property value query
|
JSplitPaneFixture |
Understands functional testing of
s:
user input simulation
state verification
property value query
|
JTabbedPaneFixture |
Understands functional testing of
s:
user input simulation
state verification
property value query
|
JTableCellFixture |
Understands functional testing of single cells in
s:
user input simulation
state verification
property value query
|
JTableFixture |
Understands functional testing of
s:
user input simulation
state verification
property value query
|
JTableHeaderFixture |
Understands functional testing of
s:
user input simulation
state verification
property value query
|
JTextComponentFixture |
Understands functional testing of
s:
user input simulation
state verification
property value query
|
JToggleButtonFixture |
Understands functional testing of
s:
user input simulation
state verification
property value query
|
JToolBarFixture |
Understands functional testing of
s:
user input simulation
state verification
property value query
|
JTreeFixture |
Understands functional testing of
s:
user input simulation
state verification
property value query
|
JTreePathFixture |
Understands functional testing of single nodes, referenced by their paths, in
s:
user input simulation
state verification
property value query
|
JTreeRowFixture |
Understands functional testing of single nodes, referenced by their row indices, in
s:
user input simulation
state verification
property value query
|
WindowFixture<T extends Window> |
Understands functional testing of
s:
user input simulation
state verification
property value query
|
Enum | Description |
---|---|
JToolBarFixture.UnfloatConstraint |
Understands constraints used to unfloat a floating
. |
The power and flexibility of FEST-Swing come from the fixtures in
this package. Although you can use the
directly, it is too
low-level and requires, in our opinion, too much code. FEST fixtures can simplify creation and maintenance of functional
GUI tests by:
BasicRobot
The following example shows how easy is to use FEST fixtures. The test verifies that an error message is displayed if the user enters her username but forgets to enter her password.
private FrameFixture
window;
@BeforeMethod public void setUp() {
window = new FrameFixture(new LoginWindow());
window.show();
}
@AfterMethod public void tearDown() {
window.cleanUp();
}
@Test public void shouldCopyTextInLabelWhenClickingButton() {
window.textBox("username").enterText("some.user");
window.button("login").click();
window.optionPane().requireErrorMessage().requireMessage("Please enter your password");
}
The test uses a
to launch the GUI to test
(FrameFixture
LoginWindow
) and find the GUI components in such window. This is the recommended way to use FEST. We
could also use individual fixtures to simulate user events, but it would result in more code to write and maintain:
private BasicRobot
robot;
@BeforeMethod public void setUp() {
robot = BasicRobot.robotWithNewAwtHierarchy();
robot.showWindow(new LoginWindow());
}
@AfterMethod public void tearDown() {
robot.cleanUp();
}
@Test public void shouldCopyTextInLabelWhenClickingButton() {
new JTextComponentFixture
(robot, "username").enterText("some.user");
new JButtonFixture
(robot, "login").click();
new JOptionPaneFixture
(robot).requireErrorMessage().requireMessage("Please enter your password");
}
Note: It is very important to clean up resources used by FEST (keyboard, mouse and opened windows) after
each test; otherwise, the FEST robot will keep control of them and can make your computer pretty much unusable. To clean
up resources call the method 'cleanUp' from
,
BasicRobot
or FrameFixture
.
DialogFixture
Each fixture has the name of the GUI component it can control plus the word "Fixture" at the end. For example,
can simulate user events on
JButtonFixture
s.
JButton
Copyright © 2007-2012 FEST (Fixtures for Easy Software Testing). All Rights Reserved.