Class TestFXRule

  • All Implemented Interfaces:
    org.junit.rules.TestRule

    public class TestFXRule
    extends org.junit.rules.TestWatcher
    Optional JUit rule that can be used to ensure the JavaFX platform has been initialized before UI tests are run. The rule can also be used for retrying flaky tests.

    The rule can be used by adding a @Rule annotated field to your test class:

    {@code
     public class MyTest extends ApplicationTest {
         {@literal @}Rule public TestFXRule testFXRule = new TestFXRule();
    • Constructor Detail

      • TestFXRule

        public TestFXRule()
      • TestFXRule

        public TestFXRule​(int retryCount)
    • Method Detail

      • apply

        public org.junit.runners.model.Statement apply​(org.junit.runners.model.Statement base,
                                                       org.junit.runner.Description description)
        Specified by:
        apply in interface org.junit.rules.TestRule
        Overrides:
        apply in class org.junit.rules.TestWatcher
      • starting

        protected void starting​(org.junit.runner.Description description)
        Overrides:
        starting in class org.junit.rules.TestWatcher