FEST-Swing is a Java library that provides a fluent interface for functional Swing GUI testing. It provides an easy-to-use API that makes creation and maintenance of GUI tests easy.
Why do we need to test GUIs?
Testing GUIs can make the entire system safer and more robust. Any GUI, even one providing only the simplest capabilities, likely encloses some level of complexity. Any complexity in software must be tested because code without tests is a potential source of bugs. A well-tested application has a greater chance of success.
GUI testing is also essential during application maintenance. During this phase, code might be refactored frequently to improve design, and this code often encloses great portions of the user interface. Having a solid test suite that includes GUI code can give us confidence that we are not inadvertently introducing bugs.
The following example shows a test verifying that an error message is displayed if the user forgets to enter her password when trying to log in an application:
.requireMessage("Please enter your password");
Here are some key features of "FEST-Swing":
· Simulation of user interaction with a GUI (e.g. mouse and keyboard input)
· Reliable GUI component lookup (by type, by name or custom search criteria)
· Support for all Swing components included in the JDK
· Compact and powerful API for creation and maintenance of functional GUI tests
· Ability to embed screenshots of failed GUI tests in HTML test reports
· Can be used with either JUnit or TestNG
· Experimental Groovy Builder support (coming soon!)
· Java 2 Standard Edition Runtime Environment
What's New in This Release: [ read full changelog ]
· [FEST-341] – Error in ScreenshotOnFailureListener.takeScreenshotAndReturnFileName. Thanks to Grego.
· [FEST-342] – Javadocs in methods annotated with @RunsInCurrentThread are wrong.
· [FEST-345] – KeyStrokeMappingProviderNames uses the wrong name for KeyStrokeMappingProvider. Thanks to Olivier DOREMIEUX.
· [FEST-347] – Incorporate keyboard mapping for French MacOS. Thanks to Olivier DOREMIEUX.
· [FEST-348] – Fix implementation of ’selectAll’ in JTextComponentDriver. Thanks to Olivier DOREMIEUX.
· [FEST-355] – ComponentFixture validateNotNull method visibility.
· [FEST-354] – Move class SystemProperties from fest-swing to fest-util.
· [FEST-343] – Update FEST-Reflect dependency to version 1.2.
· [FEST-344] – Update FEST-Util dependency to version 1.1.2.