FEST-Swing 0.8 released!
This blog has been moved to http://alexruiz.developerblogs.com/!
We are proud to announce that FEST-Swing 0.8 is out!
FEST-Swing is a Java library that provides a fluent interface for functional Swing GUI testing. This library provides an easy-to-use API that makes creation and maintenance of GUI tests easy.
Changelog:
-
If a matching component cannot be found in a lookup, the thrown
ComponentLookupExceptionincludes the AWT component hierarchy being used in a test. This information can be helpful when diagnosing the component lookup failure.The following is a sample stack trace of a failed component lookup:
org.fest.swing.exception.ComponentLookupException: Unable to find component using matcher org.fest.swing.core.NameMatcher[name='ok', requireShowing=false]. Component hierarchy: org.fest.swing.test.TestFrame[name='testFrame', title='Test', enabled=true, showing=true] javax.swing.JRootPane[] javax.swing.JPanel[name='null.glassPane'] javax.swing.JLayeredPane[] javax.swing.JPanel[name='null.contentPane'] javax.swing.JButton[name='click', text='Click Me', enabled=true] at org.fest.swing.core.BasicComponentFinder.componentNotFound(BasicComponentFinder.java:81)For more information, please visit the section "Troubleshooting Component Lookups."
Fixes bug 71. Many thanks to Wim Deblauwe.
-
In a similar way, if a component lookup found more than one matching component, the thrown
ComponentLookupExceptionincludes all the components that were found. For example:org.fest.swing.exception.ComponentLookupException: Found more than one component using matcher org.fest.swing.core.TypeMatcher[type=javax.swing.JButton, requireShowing=false]. Found: javax.swing.JButton[name='first', text='First Button', enabled=true] javax.swing.JButton[name='second', text='Second Button', enabled=true] at org.fest.swing.core.BasicComponentFinder.multipleComponentsFound(BasicComponentFinder.java:102)
For more information, please visit the section "Troubleshooting Component Lookups."
Fixes bug 81. Many thanks to Wim Deblauwe.
-
Added component formatters. Component formatters provide a
Stringrepresentation of a Swing component. Unlike the default 'toString' method, component formatters include information useful for functional GUI testing (excludes colors, sizes, layouts, etc.)The following are some examples:
org.fest.swing.test.TestFrame[name='frame', title='FormattingTest', enabled=true, showing=true]javax.swing.JList[name='list', selectedValues=['One', 2], contents=['One', 2, 'Three', 4], selectionMode=MULTIPLE_INTERVAL_SELECTION, enabled=true]javax.swing.JOptionPane[message='A message', messageType=ERROR_MESSAGE, optionType=DEFAULT_OPTION, enabled=true, showing=false]javax.swing.JTabbedPane[name='tabbedPane', selectedTabIndex=1, selectedTabTitle='Second', tabCount=2, tabTitles=['First', 'Second'], enabled=true]:
FEST-Swing provides component formatters for all the JDK-provided Swing components. Component formatters can be overridden with user-defined ones. For more information please visit the section "Component Formatters."
-
Added "scopes" for component lookups. By default, only Swing components that are shown on the screen can participate in a lookup, with the exception of
JMenuItems, which are visible only when they are being selected.Currently, FEST-Swing provides three scopes:
DEFAULT,SHOWING_ONLYandALL. The following is an example of how to set the scope of component lookup to "showing" components only:Settings.componentLookupScope(ComponentLookupScope.SHOWING_ONLY);
For more information please visit
ComponentLookupScopeJavadoc and the section "Using a ContainerFixture to Look Up Components."Fixes bug 80. Many thanks to Wim Deblauwe and Volker Berlin.
-
Added method '
robotAutoDelay' in class 'org.fest.swing.core.Settings' to configure test speed. Fixes issue 69. Many thanks to Wim Deblauwe. -
Renamed method '
menuItem(String...)' inContainerFixtureto 'menuItemWithPath(String...)'. Fixes bug 88. Many thanks to Rich Toulouse. -
Added
JScrollBarFixtureandJScrollPaneFixture. Fixes issue 75. Many thanks to Fabien Barbero. -
Added
JInternalFrameFixture. Fixes issue 70. Many thanks to Ken Geis. -
Added
org.fest.swing.core.NameAndTypeMatcherto lookup GUI components by name and type. -
Added method '
requireValue(Object)' toJSpinnerFixture. Fixes issue 73. Many thanks to Wim Deblauwe. -
Added method '
increment(int)' toJSpinnerFixture. Fixes issue 74. Many thanks to Wim Deblauwe. -
Added method '
decrement(int)' toJSpinnerFixture. -
Added class
JListItemFixture. This class knows how to simulate user input on a specific item of aJList. Fixes issue 63. Many thanks to Fabien Barbero. -
Added method '
item(int)' and 'item(String)' toJListFixture. These methods return aJListItemFixture. Fixes issue 63. Many thanks to Fabien Barbero. -
Added method '
showPopupMenuAt(Point)' toComponentFixture(and therefore to all fixtures). Fixes issue 63. Many thanks to Fabien Barbero. -
Added method '
requireSelection(String)' toJComboBoxFixture. Fixes issue 52. Many thanks to John Stephi. -
Added methods '
requireSelection(String)' and 'requireSelectedItems(String...)' toJListFixture. Fixes issue 52. Many thanks to Wim Deblauwe. -
Added methods '
selectItems(int...)' and 'selectItems(String...)' to allow multiple-selection aJListFixture. Fixes issue 64. Many thanks to Fabien Barbero. -
Added method '
selectItems(Range.From, Range.To)' to allow selection of a range of items in aJListFixture. Fixes 64. Many thanks to Wim Deblauwe. -
Added methods '
okButton', 'cancelButton', 'yesButton' and 'noButton' toJOptionPaneFixture. These methods return aJButtonFixturewrapping the buttons in aJOptionPane. Fixes issue 66. Many thanks to Wim Deblauwe and Volker Berlin. -
Added method '
panel' to classContainerFixture.FrameFixtureandDialogFixturecan now lookup aJPanel(or subclass) by type, by name or by custom search criteria. Fixes issue 67. Many thanks to Rich Toulouse. -
To make debugging easier, we added a '
toString' implementation toorg.fest.swing.core.NameMatcherorg.fest.swing.core.TypeMatcherorg.fest.swing.fixture.JMenuItemMatcherorg.fest.swing.fixture.JButtonMatcher
-
Moved '
print' methods fromorg.fest.swing.core.ComponentFinderto the new classorg.fest.swing.core.ComponentPrinter. -
Renamed methods '
wait' and 'delay' inRobotFixtureto 'pause'. Then moved all the versions of th method 'pause' to the new classorg.fest.swing.core.Pause. -
ComponentFinders now match components if 'isShowing()' is true, instead of checking for 'isVisible()'. Fixes bug 76. Many thanks to Wim Deblauwe. -
Added method '
moveTo(Point)' toFrameFixtureandDialogFixture. -
Added method '
invokeAndWait(Runnable)' toRobotFixture.
Fixes bug 71. Many thanks to Wim Deblauwe.
You can download FEST here (file fest-swing-0.8.zip.) FEST requires Java SE 5.0 or later.
Here are some useful links:
Feedback is always appreciated


Posted by custom myspace layouts on January 11, 2008 at 09:56 AM PST #