Functional Swing GUI Testing
This module provides a simple and intuitive API for functional testing of Swing user interfaces, resulting in tests that are compact, easy to write, and read like a specification. Tests written using FEST-Swing are also robust. FEST simulates actual user gestures at the operating system level, ensuring that the application will behave correctly in front of the user. It also provides a reliable mechanism for GUI component lookup that ensures that changes in the GUI's layout or look-and-feel will not break your tests.
FEST makes troubleshooting failures a lot easier. It can take screenshots of the desktop at the moment of a test failure, to make it easier to determine if the failure was due to a programming error or an unexpected environment event. When a GUI test fails, FEST also provides useful information in the failure message, such as a nicely-formatted GUI component hierarchy, allowing developers to quickly inspect the cause of the failure.
The following example simulates a user logging-in into a Swing application. The test verifies that an error message is displayed if the user forgets to enter her password.
FEST-Swing can test desktop applications as well as applets (in a viewer and in-browser.)
For more details, please visit the Swing Module Wiki.
This module provides a fluent interface for assertions. FEST's assertions are incredibly easy to write: just type "assertThat" followed the actual value and a dot, and any Java IDE will show you all the assertions available for the type of the given object to verify. No more confusion about the order of the "expected" and "actual" values. Our assertions are very readable as well: they read very close to plain English, making it easier for non-technical people to read test code.
Here are some examples:
For more details, please visit the Assertions Module Wiki.
This module provides an intuitive, compact and type-safe fluent API for Java reflection. It makes Java reflection tremendously easy to use: no more casting, checked exceptions,
PriviledgedAction or calls to
setAccessible . FEST's reflection module can even overcome the limitations of generics and type erasure.
For more details, please visit the Reflection Module Wiki.
Our EasyMock template eliminates code duplication (repetitive calls to replay and verify) and clearly separates expectations from code to test.
Note: We are no longer developing the EasyMock template. We are currently replacing EasyMock with Mockito in our own tests. Since, in our opinion, Mockito's API is really nice and compact, it does not require a template.
If you are an EasyMock user, please visit the EasyMock Template Wiki.