From a956637b8b7511befd341e424afbd30a60d0948c Mon Sep 17 00:00:00 2001 From: jan-vcapgemini Date: Tue, 14 Mar 2023 22:36:47 +0100 Subject: [PATCH] #1454 added 2nd template set artifact to test --- .../cobigen/gui/ProcessTemplateSetTest.java | 19 ++++----- ...va-server-app-2021.12.007-template-set.xml | 2 +- ...pi-server-app-2021.12.007-template-set.xml | 39 +++++++++++++++++++ 3 files changed, 50 insertions(+), 10 deletions(-) create mode 100644 cobigen/gui/src/test/resources/testdata/integrationtests/ProcessTemplateSetTest/crud-openapi-server-app-2021.12.007-template-set.xml diff --git a/cobigen/gui/src/test/java/com/devonfw/cobigen/gui/ProcessTemplateSetTest.java b/cobigen/gui/src/test/java/com/devonfw/cobigen/gui/ProcessTemplateSetTest.java index 49bcf9a6a..47de84cd6 100644 --- a/cobigen/gui/src/test/java/com/devonfw/cobigen/gui/ProcessTemplateSetTest.java +++ b/cobigen/gui/src/test/java/com/devonfw/cobigen/gui/ProcessTemplateSetTest.java @@ -64,10 +64,14 @@ public void testInstallTemplateSet() throws Exception { // simulate template-set-list folder for downloaded template-set.xml files to be used in GUI File artifactCacheFolder = this.tmpFolder.newFolder("UserHome", "template-sets", "template-set-list"); - Path templateSetXmlFile = TEST_FILE_ROOT_PATH.resolve("crud-java-server-app-2021.12.007-template-set.xml"); - Files.copy(templateSetXmlFile, + Path templateSetXmlFile1 = TEST_FILE_ROOT_PATH.resolve("crud-java-server-app-2021.12.007-template-set.xml"); + Files.copy(templateSetXmlFile1, artifactCacheFolder.toPath().resolve("crud-java-server-app-2021.12.007-template-set.xml"), StandardCopyOption.REPLACE_EXISTING); + Path templateSetXmlFile2 = TEST_FILE_ROOT_PATH.resolve("crud-openapi-server-app-2021.12.007-template-set.xml"); + Files.copy(templateSetXmlFile2, + artifactCacheFolder.toPath().resolve("crud-openapi-server-app-2021.12.007-template-set.xml"), + StandardCopyOption.REPLACE_EXISTING); withEnvironmentVariable(ConfigurationConstants.CONFIG_ENV_HOME, userHome.getAbsolutePath()).execute(() -> { List templateSetConfigurations = ArtifactRetriever.retrieveArtifactsFromCache(); @@ -77,16 +81,13 @@ public void testInstallTemplateSet() throws Exception { for (TemplateSetConfiguration configuration : templateSetConfigurations) { this.templateSetObservableList.addAll(configuration); } - }); - - this.searchResultsView.setItems(this.templateSetObservableList); - Button installButton = find("#installButton"); - String installButtonText = installButton.getText(); + this.searchResultsView.setItems(this.templateSetObservableList); - sleep(1000); + Button installButton = find("#installButton"); + String installButtonText = installButton.getText(); - withEnvironmentVariable(ConfigurationConstants.CONFIG_ENV_HOME, userHome.getAbsolutePath()).execute(() -> { + sleep(1000); // clicks on first element of searchResultsView clickOn(this.searchResultsView.getItems().get(0).getContextConfiguration().getTrigger().get(0).getId()); diff --git a/cobigen/gui/src/test/resources/testdata/integrationtests/ProcessTemplateSetTest/crud-java-server-app-2021.12.007-template-set.xml b/cobigen/gui/src/test/resources/testdata/integrationtests/ProcessTemplateSetTest/crud-java-server-app-2021.12.007-template-set.xml index c80976b27..7790a68bb 100644 --- a/cobigen/gui/src/test/resources/testdata/integrationtests/ProcessTemplateSetTest/crud-java-server-app-2021.12.007-template-set.xml +++ b/cobigen/gui/src/test/resources/testdata/integrationtests/ProcessTemplateSetTest/crud-java-server-app-2021.12.007-template-set.xml @@ -2,7 +2,7 @@ - + diff --git a/cobigen/gui/src/test/resources/testdata/integrationtests/ProcessTemplateSetTest/crud-openapi-server-app-2021.12.007-template-set.xml b/cobigen/gui/src/test/resources/testdata/integrationtests/ProcessTemplateSetTest/crud-openapi-server-app-2021.12.007-template-set.xml new file mode 100644 index 000000000..6a7e091ee --- /dev/null +++ b/cobigen/gui/src/test/resources/testdata/integrationtests/ProcessTemplateSetTest/crud-openapi-server-app-2021.12.007-template-set.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file