Your SlideShare is downloading. ×
0
Fest
Fest
Fest
Fest
Fest
Fest
Fest
Fest
Fest
Fest
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Fest

1,609

Published on

A nice way of testing swing component using fest (fixture for easy testing).

A nice way of testing swing component using fest (fixture for easy testing).

Published in: Technology, Art & Photos
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,609
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
20
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. FEST(A)! - TESTING SWING COMPONENTS WITH FEST Andreas Enbohm, Capgemini
  • 2. Agenda <ul><li>Basics of FEST </li></ul><ul><li>Code Examples and Demo </li></ul><ul><li>B &amp; C’s </li></ul><ul><li>How ERE uses Fest </li></ul><ul><li>Q&amp;A </li></ul>
  • 3. FEST <ul><li>Fixtures For Easy Software Testing, released nov - 08 </li></ul><ul><li>Java-based framework, works with JUnit, TestNG, standalone </li></ul><ul><li>Several modules in FEST (swing, assert, reflect, mocking) </li></ul><ul><li>’ Fluent Interface’ (a.k.a. internal DSL) </li></ul><ul><li>Features: </li></ul><ul><ul><li>Simulation of user interaction with a GUI (e.g. mouse and keyboard input) </li></ul></ul><ul><ul><li>Reliable GUI component lookup (by type, by name or custom search criteria) </li></ul></ul><ul><ul><li>Support for all Swing components included in the JDK </li></ul></ul><ul><ul><li>Supports Applet testing </li></ul></ul><ul><ul><li>Ability to embed screenshots of failed GUI tests in HTML test reports </li></ul></ul><ul><ul><li>Verifying colors and fonts </li></ul></ul>
  • 4. FEST – Swing Module <ul><li>Supported Input - Mouse - Keyboard - Drag ’n Drop </li></ul><ul><li>Support of Running Tests without any desktop installed - Xvfb - Good for both CI and local environment </li></ul><ul><li>Apache 2.0 License, Hosted at Google Code </li></ul>
  • 5. FEST – Swing Module <ul><li>Fixtures - one fixture per swing component (e.g. JButtonFixture ) - provide method for user interaction, button.click() - implicit assertions, if ’click’ fails an assertion error is thrown - good for testing ’single’ UI component (see demo) </li></ul><ul><li>Robot - used for looking up various components - used for more low level operations robot.click(component) - requires more work than using fixtures - needs to be used if testing ’running application’ (see demo) </li></ul>
  • 6. FEST – Swing Module <ul><li>Simple Example </li></ul>FrameFixture dialog = new FrameFixture(new MyFrame()); dialog.comboBox(&amp;quot;domain&amp;quot;).select(&amp;quot;Users&amp;quot;); dialog.textBox(&amp;quot;username&amp;quot;).enterText(“Chuck Norris&amp;quot;); dialog.button(&amp;quot;login&amp;quot;).click(); //Assert we have an error message dialog.optionPane().requireErrorMessage().requireMessage(&amp;quot;Please enter your password&amp;quot;);
  • 7. FEST - Extensions <ul><li>FEST – Assert with fluent interfaces </li></ul><ul><li>FEST – Reflect </li></ul><ul><li>FEST – Mocking </li></ul>int removed = employees.removeFired(); assertThat(removed).isZero(); List&lt;Employee&gt; newEmployees = employees.hired(TODAY); ‘ assertThat(newEmployees).hasSize(6).contains(frodo, sam); String[] newHires = employees.newHiresNames(); assertThat(newHires).containsOnly(&amp;quot;Gandalf&amp;quot;, &amp;quot;Arwen&amp;quot;, &amp;quot;Gimli&amp;quot;); assertThat(yoda).isInstanceOf(Jedi.class).isEqualTo(foundJedi).isNotEqualTo(foundSith);
  • 8. DEMO <ul><li>Verify Title </li></ul><ul><li>Verify Button Click Behaviour </li></ul><ul><li>Screenshots when test fails </li></ul>
  • 9. FEST – B &amp; C’s <ul><li>Easy to begins with, very much like writing ’usual’ tests </li></ul><ul><li>Taking screenshots when test failures </li></ul><ul><li>Good documentation </li></ul><ul><li>Access / update GUI components – should be done via EDT </li></ul><ul><li>Different behaviour (i.e. focus problem, Z-order of windows) of different platforms. May result in test failure </li></ul><ul><li>Not possible to record user interaction </li></ul><ul><li>Test takes long time to run </li></ul>
  • 10. FEST <ul><li>Q&amp;A </li></ul><ul><li>http://fest.easytesting.org/swing/wiki/pmwiki.php </li></ul>

×