From 1196b48c11408ec0c0bfa8e918c8d697ea0af8c0 Mon Sep 17 00:00:00 2001 From: Arved Solth Date: Mon, 16 Jan 2023 16:35:29 +0100 Subject: [PATCH] Resolve Codacy issues --- .../java/org/kitodo/selenium/MetadataST.java | 20 +++++++++---------- .../pages/MetadataEditorPage.java | 4 ++++ .../testframework/pages/ProcessesPage.java | 13 +++++++++++- 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/Kitodo/src/test/java/org/kitodo/selenium/MetadataST.java b/Kitodo/src/test/java/org/kitodo/selenium/MetadataST.java index b420d5ebcea..6c9d997df60 100644 --- a/Kitodo/src/test/java/org/kitodo/selenium/MetadataST.java +++ b/Kitodo/src/test/java/org/kitodo/selenium/MetadataST.java @@ -13,6 +13,16 @@ import static org.junit.Assert.assertEquals; +import java.io.IOException; +import java.net.URI; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; +import java.util.stream.Collectors; + import org.junit.After; import org.junit.Assert; import org.junit.Test; @@ -28,16 +38,6 @@ import org.kitodo.selenium.testframework.BaseTestSelenium; import org.kitodo.selenium.testframework.Pages; -import java.io.IOException; -import java.net.URI; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; -import java.util.stream.Collectors; - /** * Tests for functions in the metadata editor. */ diff --git a/Kitodo/src/test/java/org/kitodo/selenium/testframework/pages/MetadataEditorPage.java b/Kitodo/src/test/java/org/kitodo/selenium/testframework/pages/MetadataEditorPage.java index 0a8899cbd82..2f41a5ef648 100644 --- a/Kitodo/src/test/java/org/kitodo/selenium/testframework/pages/MetadataEditorPage.java +++ b/Kitodo/src/test/java/org/kitodo/selenium/testframework/pages/MetadataEditorPage.java @@ -63,6 +63,10 @@ public String getNumberOfScans() { return numberOfScans.getText(); } + /** + * Change order of child processes in metadata editor by moving the second child process before + * the first child process via drag and drop. + */ public void changeOrderOfLinkedChildProcesses() { secondChildProcess.click(); WebDriver webDriver = Browser.getDriver(); diff --git a/Kitodo/src/test/java/org/kitodo/selenium/testframework/pages/ProcessesPage.java b/Kitodo/src/test/java/org/kitodo/selenium/testframework/pages/ProcessesPage.java index 78911509811..4a5f7a53f6f 100644 --- a/Kitodo/src/test/java/org/kitodo/selenium/testframework/pages/ProcessesPage.java +++ b/Kitodo/src/test/java/org/kitodo/selenium/testframework/pages/ProcessesPage.java @@ -295,6 +295,11 @@ public void downloadLog() { + "kowal/" + Helper.getNormalizedTitle(SECOND_PROCESS_TITLE) + "_log.xml"))); } + /** + * Open second process in metadata editor. + * @throws IllegalAccessException when navigating to metadata editor page fails + * @throws InstantiationException when navigating to metadata editor page fails + */ public void editSecondProcessMetadata() throws IllegalAccessException, InstantiationException { try { setEditMetadataLink(SECOND_PROCESS_TITLE); @@ -304,6 +309,11 @@ public void editSecondProcessMetadata() throws IllegalAccessException, Instantia } } + /** + * Open third process in metadata editor. + * @throws IllegalAccessException when navigating to metadata editor page fails + * @throws InstantiationException when navigating to metadata editor page fails + */ public void editThirdProcessMetadata() throws InstantiationException, IllegalAccessException { try { setEditMetadataLink(THIRD_PROCESS_TITLE); @@ -348,7 +358,8 @@ private void setEditMetadataLink(String processTitle) throws StaleElementReferen .ignoreExceptions().until(() -> processesTable.isDisplayed()); int index = getRowIndex(processesTable, processTitle, 3); await("Wait for 'edit metadata' link to become enabled").pollDelay(1, TimeUnit.SECONDS).atMost(5, TimeUnit.SECONDS) - .ignoreExceptions().until(() -> Browser.getDriver().findElementById(PROCESSES_TABLE + ":" + index + ":readXML").isEnabled()); + .ignoreExceptions().until(() -> Browser.getDriver().findElementById(PROCESSES_TABLE + ":" + index + ":readXML") + .isEnabled()); editMetadataLink = Browser.getDriver().findElementById(PROCESSES_TABLE + ":" + index + ":readXML"); }