Skip to content

Commit

Permalink
Resolve Codacy issues
Browse files Browse the repository at this point in the history
  • Loading branch information
solth committed Feb 7, 2023
1 parent d5a82cd commit 1196b48
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 11 deletions.
20 changes: 10 additions & 10 deletions Kitodo/src/test/java/org/kitodo/selenium/MetadataST.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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");
}

Expand Down

0 comments on commit 1196b48

Please sign in to comment.