Skip to content

naimdjon/TestFX

 
 

Repository files navigation

TestFX

Easy-to-use library for testing JavaFX. TestFX provides:

  • A fluent and clean API for interacting with, and verifying the behavior of, JavaFX applications.
  • Supports Hamcrest Matchers and Lambda expressions.
  • Screenshots of failed tests.
  • Supports JavaFX 2 and JavaFX 8.

Changelog

Usage Example

class DesktopTest extends GuiTest {
  public Parent getRootNode() {
    return new Desktop()
  }

  @Test
  public void shouldBeAbleToDragFileToTrashCan() {
    // GIVEN
    rightClick("#desktop").move("New").click("Text Document")
                          .type("myTextfile.txt").push(ENTER);
  
    // WHEN
    drag(".file").to("#trash-can");
    
    // THEN
    verifyThat("#desktop", contains(0, ".file"));
  }
}

Documentation

Links

Motivation

The motivation for creating TestFX was that the existing library for testing JavaFX, Jemmy, was too verbose and unwieldy. We wanted more behavior driven tests with easy-to-read code that our tester could follow and modify on her own. Today, TestFX is used in all of the about 100 automated GUI tests in LoadUI (source code, video).

Comparison with Jemmy

You might also want to try Automaton, a new testing framework that supports JavaFX as well as Swing.

Mailing list

Head over to testfx-discuss@googlegroups.com for discussions, questions and announcements.

Credits

TestFX was initially created by @dainnilsson and @minisu as a part of LoadUI in 2012. Today, it is being extended and maintained by @hastebrot, @Philipp91, @minisu and the other contributors.

About

Simple and clean testing for JavaFX.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 94.2%
  • Groovy 5.8%