From 01f059d9a96f58bbe416259f3b0432dcbb74e0ae Mon Sep 17 00:00:00 2001 From: Ikram Maalej Date: Tue, 31 Jan 2023 14:12:52 +0100 Subject: [PATCH] Fix codacy issues --- .../org/kitodo/selenium/testframework/Browser.java | 5 +++++ .../testframework/pages/ProcessesPage.java | 14 ++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/Kitodo/src/test/java/org/kitodo/selenium/testframework/Browser.java b/Kitodo/src/test/java/org/kitodo/selenium/testframework/Browser.java index 7e0c525f623..2618195861f 100644 --- a/Kitodo/src/test/java/org/kitodo/selenium/testframework/Browser.java +++ b/Kitodo/src/test/java/org/kitodo/selenium/testframework/Browser.java @@ -219,6 +219,11 @@ public static List getRowsOfTable(WebElement table) { return table.findElements(By.tagName("tr")); } + /** + * Gets number of selected rows in a given table. + * @param table as a WebElement + * @return number of selected rows + */ public static long getSelectedRowsOfTable(WebElement table) { return getRowsOfTable(table) .stream() 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 79c9febe7bb..ee404ea7c49 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 @@ -207,6 +207,11 @@ public int countListedBatches() throws Exception { return batchSelect.getOptions().size(); } + /** + * Gets number of selected rows in processesTable. + * @return number of selected rows + * @throws Exception exception + */ public long countListedSelectedProcesses() throws Exception { if (!isAt()) { goTo(); @@ -460,6 +465,9 @@ public void clickProcessesTableHeaderForSorting(int column) { .until(() -> !columnHeader.getAttribute("aria-sort").equals(previousAriaSort)); } + /** + * Select all rows on a page in processesTable. + */ public void selectAllRowsOnPage() { selectAllCheckBox.click(); await(WAIT_FOR_SELECTION_MENU).pollDelay(700, TimeUnit.MILLISECONDS) @@ -469,6 +477,9 @@ public void selectAllRowsOnPage() { .atMost(30, TimeUnit.SECONDS).until(() -> processesTable.isDisplayed()); } + /** + * Select all rows on all pages in processesTable. + */ public void selectAllRows() { selectAllCheckBox.click(); await(WAIT_FOR_SELECTION_MENU).pollDelay(700, TimeUnit.MILLISECONDS) @@ -478,6 +489,9 @@ public void selectAllRows() { .atMost(30, TimeUnit.SECONDS).until(() -> processesTable.isDisplayed()); } + /** + * Go to next page in processesTable. + */ public void goToNextPage() { if (nextPage.isEnabled()) { nextPage.click();