diff --git a/cobigen/gui/src/main/resources/com/devonfw/cobigen/gui/fxml/Home.fxml b/cobigen/gui/src/main/resources/com/devonfw/cobigen/gui/fxml/Home.fxml
index 3d18a10013..7504cbdf21 100644
--- a/cobigen/gui/src/main/resources/com/devonfw/cobigen/gui/fxml/Home.fxml
+++ b/cobigen/gui/src/main/resources/com/devonfw/cobigen/gui/fxml/Home.fxml
@@ -9,7 +9,7 @@
-
+
diff --git a/cobigen/gui/src/main/resources/com/devonfw/cobigen/gui/fxml/Menu.fxml b/cobigen/gui/src/main/resources/com/devonfw/cobigen/gui/fxml/Menu.fxml
index 61d878e109..7b875b5ca5 100644
--- a/cobigen/gui/src/main/resources/com/devonfw/cobigen/gui/fxml/Menu.fxml
+++ b/cobigen/gui/src/main/resources/com/devonfw/cobigen/gui/fxml/Menu.fxml
@@ -24,7 +24,6 @@
-
-
-
-
diff --git a/cobigen/gui/src/test/java/com/devonfw/cobigen/gui/HomePageTest.java b/cobigen/gui/src/test/java/com/devonfw/cobigen/gui/HomePageTest.java
index d90662e25c..a91a729672 100644
--- a/cobigen/gui/src/test/java/com/devonfw/cobigen/gui/HomePageTest.java
+++ b/cobigen/gui/src/test/java/com/devonfw/cobigen/gui/HomePageTest.java
@@ -7,6 +7,7 @@
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.scene.control.Hyperlink;
+import javafx.scene.control.ListView;
import javafx.scene.control.TreeItem;
import javafx.scene.control.TreeView;
@@ -37,7 +38,7 @@ public void clickOnBogusElement() {
@Test
public void ensureHomePageIsShownOnStartUp() {
- Assertions.assertThat(this.mainRoot.lookup("#homePane").getParent().equals(this.mainRoot.lookup("#detailsPane")));
+ Assertions.assertThat(this.home);
}
/**
@@ -46,12 +47,15 @@ public void ensureHomePageIsShownOnStartUp() {
@Test
public void ensureHomePageIsShownOnHomeButtonClicked() {
- // TODO: Switch to a Template Set before switching back to Home
- String TEMPLATE_SET = "#templateSet";
- clickOn(TEMPLATE_SET);
- String HOME_BUTTON = "#homeButton";
- clickOn(HOME_BUTTON);
- Assertions.assertThat(this.mainRoot.lookup("#homePane").getParent().equals(this.mainRoot.lookup("#detailsPane")));
+ ListView searchResultsView = find("#searchResultsView");
+ searchResultsView.getSelectionModel().select(0);
+ Assertions.assertThat(searchResultsView.getSelectionModel().getSelectedIndex() == 0);
+ Assertions.assertThat(this.details.isVisible());
+ Assertions.assertThat(!this.home.isVisible());
+ // Switch back to Home
+ clickOn("#homeButton");
+ Assertions.assertThat(this.home.isVisible());
+ Assertions.assertThat(!this.details.isVisible());
}
/**
@@ -61,7 +65,7 @@ public void ensureHomePageIsShownOnHomeButtonClicked() {
public void testLinkToCobigenWiki() {
String COBIGEN_WIKI_LINK = "#wikilink";
- this.wikilink = (Hyperlink) this.mainRoot.lookup(COBIGEN_WIKI_LINK);
+ this.wikilink = find(COBIGEN_WIKI_LINK);
Assertions.assertThat(!this.wikilink.isPressed());
clickOn(COBIGEN_WIKI_LINK);
Assertions.assertThat(this.wikilink.isPressed());
diff --git a/cobigen/gui/src/test/java/com/devonfw/cobigen/gui/TestFXBase.java b/cobigen/gui/src/test/java/com/devonfw/cobigen/gui/TestFXBase.java
index 61e4858daa..e07c9bfc39 100644
--- a/cobigen/gui/src/test/java/com/devonfw/cobigen/gui/TestFXBase.java
+++ b/cobigen/gui/src/test/java/com/devonfw/cobigen/gui/TestFXBase.java
@@ -11,6 +11,7 @@
import javafx.fxml.FXMLLoader;
import javafx.scene.Node;
+import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.input.KeyCode;
import javafx.scene.input.MouseButton;
@@ -29,6 +30,10 @@ public class TestFXBase extends ApplicationTest {
Controller controller;
+ Parent home;
+
+ Parent details;
+
protected static ResourceBundle bundle;
/**
@@ -66,6 +71,9 @@ public void start(Stage stage) throws Exception {
stage.setScene(new Scene(this.mainRoot));
stage.show();
stage.toFront();
+
+ this.home = find("#home");
+ this.details = find("#details");
}
/**