diff --git a/src/test/java/seedu/address/ui/testutil/UiPartRule.java b/src/test/java/seedu/address/ui/testutil/UiPartRule.java index ec8206a546dd..b3378e15a4ae 100644 --- a/src/test/java/seedu/address/ui/testutil/UiPartRule.java +++ b/src/test/java/seedu/address/ui/testutil/UiPartRule.java @@ -14,6 +14,14 @@ public class UiPartRule extends StageRule { private static final String[] CSS_FILES = {"view/DarkTheme.css", "view/Extensions.css"}; + // This is a workaround to solve headless test failure on Windows OS + // Refer to https://github.com/javafxports/openjdk-jfx/issues/66 for more details. + static { + if (System.getProperty("os.name").toLowerCase().startsWith("win")) { + System.loadLibrary("WindowsCodecs"); + } + } + public void setUiPart(final UiPart uiPart) { try { FxToolkit.setupScene(() -> { diff --git a/src/test/java/systemtests/SystemTestSetupHelper.java b/src/test/java/systemtests/SystemTestSetupHelper.java index 82811ba874f0..9d621fff3d43 100644 --- a/src/test/java/systemtests/SystemTestSetupHelper.java +++ b/src/test/java/systemtests/SystemTestSetupHelper.java @@ -18,6 +18,14 @@ public class SystemTestSetupHelper { private TestApp testApp; private MainWindowHandle mainWindowHandle; + // This is a workaround to solve headless test failure on Windows OS + // Refer to https://github.com/javafxports/openjdk-jfx/issues/66 for more details. + static { + if (System.getProperty("os.name").toLowerCase().startsWith("win")) { + System.loadLibrary("WindowsCodecs"); + } + } + /** * Sets up a new {@code TestApp} and returns it. */