Description
Enables UI testing with FEST. 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. Tests created with FEST usually belong to the integration type, as they rely on testing your application from the end-user's point of view: the UI.
Installation
The current version of griffon-fest-plugin is 0.3
To install just issue the following command
griffon install-plugin fest
Usage
Fest plugin provides the following scripts:
- create-fest-test: this script will create a new FEST test based on a common template, the resulting file will be place at $basedir/test/fest.
Every FEST test must initialize the application properly and cleanup any resources after each test method has run. The base FEST testcase enforces this by making the following methods final: setUp(), tearDown(). However you may perform additional steps during those phases by overriding onSetup() and onTearDown() respectively. Here as a sample testcase that demonstrates its usage
import org.fest.swing.fixture.* import griffon.test.FestSwingTestCase class WordFinderTests extends FestSwingTestCase { // instance variables: // app - current application // window - value returned from initWindow() // defaults to app.appFrames[0] void testNoWordPresentThenInvalidText() { window.with { textBox("wordValue").enterText "" button("findWord").click() label("answer").requireText WordFinderModel.TYPE_A_WORD } } void testDefinitionPresent() { window.with { textBox("wordValue").enterText "pugnacious" button("findWord").click() label("answer").requireText "Combative in nature; belligerent." } } void testWordPresentThenUnknownWord() { window.with { textBox("wordValue").enterText "Bogus" button("findWord").click() label("answer").requireText WordFinderModel.UNKNOWN_WORD } } }
The FEST plugin can provide cobertura reports if the code-coverage plugin is installed, just make sure to append a -coverage flag to the command line when running your FEST testcases
griffon test-app -fest -coverage


