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:

  1. If a matching component cannot be found in a lookup, the thrown ComponentLookupException includes 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.

  2. In a similar way, if a component lookup found more than one matching component, the thrown ComponentLookupException includes 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.

  3. Added component formatters. Component formatters provide a String representation 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."

  4. 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_ONLY and ALL. 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 ComponentLookupScope Javadoc and the section "Using a ContainerFixture to Look Up Components."

    Fixes bug 80. Many thanks to Wim Deblauwe and Volker Berlin.

  5. Added method 'robotAutoDelay' in class 'org.fest.swing.core.Settings' to configure test speed. Fixes issue 69. Many thanks to Wim Deblauwe.
  6. Renamed method 'menuItem(String...)' in ContainerFixture to 'menuItemWithPath(String...)'. Fixes bug 88. Many thanks to Rich Toulouse.
  7. Added JScrollBarFixture and JScrollPaneFixture. Fixes issue 75. Many thanks to Fabien Barbero.
  8. Added JInternalFrameFixture. Fixes issue 70. Many thanks to Ken Geis.
  9. Added org.fest.swing.core.NameAndTypeMatcher to lookup GUI components by name and type.
  10. Added method 'requireValue(Object)' to JSpinnerFixture. Fixes issue 73. Many thanks to Wim Deblauwe.
  11. Added method 'increment(int)' to JSpinnerFixture. Fixes issue 74. Many thanks to Wim Deblauwe.
  12. Added method 'decrement(int)' to JSpinnerFixture.
  13. Added class JListItemFixture. This class knows how to simulate user input on a specific item of a JList. Fixes issue 63. Many thanks to Fabien Barbero.
  14. Added method 'item(int)' and 'item(String)' to JListFixture. These methods return a JListItemFixture. Fixes issue 63. Many thanks to Fabien Barbero.
  15. Added method 'showPopupMenuAt(Point)' to ComponentFixture (and therefore to all fixtures). Fixes issue 63. Many thanks to Fabien Barbero.
  16. Added method 'requireSelection(String)' to JComboBoxFixture. Fixes issue 52. Many thanks to John Stephi.
  17. Added methods 'requireSelection(String)' and 'requireSelectedItems(String...)' to JListFixture. Fixes issue 52. Many thanks to Wim Deblauwe.
  18. Added methods 'selectItems(int...)' and 'selectItems(String...)' to allow multiple-selection a JListFixture. Fixes issue 64. Many thanks to Fabien Barbero.
  19. Added method 'selectItems(Range.From, Range.To)' to allow selection of a range of items in a JListFixture. Fixes 64. Many thanks to Wim Deblauwe.
  20. Added methods 'okButton', 'cancelButton', 'yesButton' and 'noButton' to JOptionPaneFixture. These methods return a JButtonFixture wrapping the buttons in a JOptionPane. Fixes issue 66. Many thanks to Wim Deblauwe and Volker Berlin.
  21. Added method 'panel' to class ContainerFixture. FrameFixture and DialogFixture can now lookup a JPanel (or subclass) by type, by name or by custom search criteria. Fixes issue 67. Many thanks to Rich Toulouse.
  22. To make debugging easier, we added a 'toString' implementation to

    • org.fest.swing.core.NameMatcher
    • org.fest.swing.core.TypeMatcher
    • org.fest.swing.fixture.JMenuItemMatcher
    • org.fest.swing.fixture.JButtonMatcher
  23. Fixes bug 71. Many thanks to Wim Deblauwe.

  24. Moved 'print' methods from org.fest.swing.core.ComponentFinder to the new class org.fest.swing.core.ComponentPrinter.
  25. Renamed methods 'wait' and 'delay' in RobotFixture to 'pause'. Then moved all the versions of th method 'pause' to the new class org.fest.swing.core.Pause.
  26. ComponentFinders now match components if 'isShowing()' is true, instead of checking for 'isVisible()'. Fixes bug 76. Many thanks to Wim Deblauwe.
  27. Added method 'moveTo(Point)' to FrameFixture and DialogFixture.
  28. Added method 'invokeAndWait(Runnable)' to RobotFixture.

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

Comments [1]

Comments:

This is really amazing . I like the way you have been writing this . Its a really helpful blog .

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

Post a Comment:

Name:
E-Mail:
URL:

Your Comment:

HTML Syntax: NOT allowed