diff --git a/src/test/java/playground/swing/SwingAppWithJavaFXAndJEditorPaneTest.java b/src/test/java/playground/swing/SwingAppWithJavaFXAndJEditorPaneTest.java index 0828c2f3..c39ad0e6 100644 --- a/src/test/java/playground/swing/SwingAppWithJavaFXAndJEditorPaneTest.java +++ b/src/test/java/playground/swing/SwingAppWithJavaFXAndJEditorPaneTest.java @@ -1,5 +1,6 @@ package playground.swing; +import org.testng.SkipException; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -19,6 +20,11 @@ public class SwingAppWithJavaFXAndJEditorPaneTest { @BeforeClass public void setUp() { + + if (System.getenv("DISPLAY") == null) { + throw new SkipException("Skipping GUI tests as no DISPLAY is set"); + } + // Initialize the application components frame = new JFrame("Swing and JavaFX Application"); panel = new JPanel();