Monday, March 11, 2013

Fest Swing Testing in Netbeans IDE 7.3

I wanted to see if I could get the Fest Swing GUI testing framework running in NetBeans IDE (7.3).   The existing plugin was designed for 6.1; and some of the instructional images were missing.  Once I'd worked out how to install Netbeans IDE plugins I found it did work with 7.3.  Here's my version getting the sample code running in NetBeans IDE 7.3 beta 2

1. Create a File --> New Project

2. Choose Samples --> Java --> Anagram Game

















3. Right click "Test Libraries" and choose Fest and JUnit 4.10


















4.  Create a File --> New File, and select Fest Test from Swing GUI forms:

















5. Give it an appropriate name and put it in the com.toy.anagrams.ui package
















6. Add these three lines after the initComponents() method call in the constructor in Anagrams.java

        guessedWord.setName("anagramField");
        guessButton.setName("guessButton");
        feedbackLabel.setName("resultLabel");




















7.  Uncomment line 26 in the fest file you created:



8. Execute the fest file as a test, and watch the Anagram game be have text filled in automatically

No comments: