diff --git a/pom.xml b/pom.xml index 7775e6f..6c76b08 100644 --- a/pom.xml +++ b/pom.xml @@ -43,6 +43,14 @@ ${junit.version} test + + org.testfx + testfx-junit5 + 4.0.17 + test + + + diff --git a/src/test/java/de/hsfulda/onses/GuiTest.java b/src/test/java/de/hsfulda/onses/GuiTest.java new file mode 100644 index 0000000..3b93eaa --- /dev/null +++ b/src/test/java/de/hsfulda/onses/GuiTest.java @@ -0,0 +1,25 @@ +package de.hsfulda.onses; + +import javafx.stage.Stage; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.testfx.api.FxAssert; +import org.testfx.framework.junit5.ApplicationTest; +import static org.junit.jupiter.api.Assertions.*; +import static org.testfx.matcher.control.LabeledMatchers.*; + +public class GuiTest extends ApplicationTest { + private Stage stage; + + @Override + public void start(Stage stage) throws Exception { + this.stage = stage; + new App().start(stage); + } + + @Test + @DisplayName("Check Window Title") + void checkWindowsTitle() { + assertEquals("Onses - Uno", stage.getTitle()); + } +}