General mechanisms
-
API designed for readability:
our APIs are designed to make the test
scripts as close as possible to human-readable text. We avoid complex language
construct such as casts or anonymous classes, and try to use data structures
well suited to the data to be checked (indented ASCII for checking the hierarchical
contents of a Tree, two-dimensional arrays for checking the contents of a Table, etc.).
-
Smart component search:
the framework makes it possible to find UI
components without requiring that the developers assign names to all of them. For instance,
it is possible to find heavyweight components such as trees or tables without specifying
any name, and it is possible to retrieve components such as buttons or check boxes using
their displayed labels.
-
Rely on displayed information only:
the library checks the labels
displayed
by components such as tables, trees or lists, instead of the string
representation of their internal model data. To achieve this, the UI components
check the values shown by the Swing component renderers.
-
Invisible execution:
the framework does not require that the GUI
be visible when the tests are being run.
-
No modifications needed in production code
- you do not need to
ship UISpec4J's JAR with your deliverable product, and GUI tests can be written
without needing to adapt your application design.
-
Extensibility:
you can add your own custom UISpec4J components
to the library, for instance to support third-party Swing components (see
here).
Specific features
- Smart color specification: colors are specified either with a string
representation (in hexadecimal format, as in HTML), or with a human-readable name
which is an approximation of the color - for instance, AA1100 is still "red".
Limitations
-
Provides support for Swing components, and not older AWT ones
- Cannot test icons, mostly because there is no simple way to test
icons for equality
-
Cannot test focus management
- the focus system does not seem
to work when the components are not displayed.
-
No specific support for Java2D
-
No support for pure headless modes - even though UISpec4J tests run without displaying
the GUI, we still need a valid graphics toolkit available on the computer.