From 218d20ed59de10efcf298490c15ac2ce3932e940 Mon Sep 17 00:00:00 2001 From: Matthias Ronge Date: Mon, 22 Jan 2024 10:08:03 +0100 Subject: [PATCH] Remove more unnecessary code --- .../testframework/enums/TabIndex.java | 3 +- .../testframework/pages/SystemPage.java | 63 ------------------- 2 files changed, 1 insertion(+), 65 deletions(-) diff --git a/Kitodo/src/test/java/org/kitodo/selenium/testframework/enums/TabIndex.java b/Kitodo/src/test/java/org/kitodo/selenium/testframework/enums/TabIndex.java index 86ac024519d..c78f5d420f5 100644 --- a/Kitodo/src/test/java/org/kitodo/selenium/testframework/enums/TabIndex.java +++ b/Kitodo/src/test/java/org/kitodo/selenium/testframework/enums/TabIndex.java @@ -55,8 +55,7 @@ public enum TabIndex { // system page TASKMANAGER(0), - INDEXING(2), - MIGRATION(3), + MIGRATION(2), // user configuration SETTINGS(0), diff --git a/Kitodo/src/test/java/org/kitodo/selenium/testframework/pages/SystemPage.java b/Kitodo/src/test/java/org/kitodo/selenium/testframework/pages/SystemPage.java index 6a28411f371..9cf5814097a 100644 --- a/Kitodo/src/test/java/org/kitodo/selenium/testframework/pages/SystemPage.java +++ b/Kitodo/src/test/java/org/kitodo/selenium/testframework/pages/SystemPage.java @@ -95,69 +95,6 @@ public SystemPage goTo() throws Exception { return this; } - /** - * Clicks on "delete index" button and accept dialog. - */ - private void deleteIndex() throws Exception { - switchToTabByIndex(TabIndex.INDEXING.getIndex(), systemTabView); - await("Wait for delete index button").atMost(20, TimeUnit.SECONDS).ignoreExceptions() - .until(() -> isButtonClicked.test(deleteIndexButton)); - - Predicate isAlertPresent = (d) -> { - d.switchTo().alert(); - return true; - }; - - await("Wait for alert").atMost(5, TimeUnit.SECONDS).ignoreExceptions() - .until(() -> isAlertPresent.test(Browser.getDriver())); - - Browser.getDriver().switchTo().alert().accept(); - Thread.sleep(Browser.getDelayIndexing()); - } - - /** - * Clicks on "create mapping" button. - */ - private void createMapping() throws Exception { - switchToTabByIndex(TabIndex.INDEXING.getIndex(), systemTabView); - await("Wait for create mapping button").atMost(20, TimeUnit.SECONDS).ignoreExceptions() - .until(() -> isButtonClicked.test(createMappingButton)); - Thread.sleep(Browser.getDelayIndexing()); - } - - /** - * Clicks on "start indexing all" button. - */ - private void startIndexingAll() throws Exception { - switchToTabByIndex(TabIndex.INDEXING.getIndex(), systemTabView); - await("Wait for start indexing button").atMost(20, TimeUnit.SECONDS).ignoreExceptions() - .until(() -> isButtonClicked.test(startIndexingAllButton)); - Thread.sleep(Browser.getDelayIndexing()); - } - - /** - * Deletes the old index, creates the mapping and starts new indexing. - */ - public void startReindexingAll() throws Exception { - switchToTabByIndex(TabIndex.INDEXING.getIndex(), systemTabView); - deleteIndex(); - createMapping(); - startIndexingAll(); - } - - /** - * Attempts to read indexing progress - * - * @return The indexing progress value as String. Empty String in case element - * is not readable. - */ - public String getIndexingProgress() throws Exception { - switchToTabByIndex(TabIndex.INDEXING.getIndex(), systemTabView); - List listOfRows = Browser.getRowsOfTable(indexingTable); - WebElement lastRow = listOfRows.get(listOfRows.size() - 1); - return lastRow.findElement(By.className("ui-progressbar-label")).getAttribute("innerHTML"); - } - public void startWorkflowMigration() throws Exception { switchToTabByIndex(TabIndex.MIGRATION.getIndex(), systemTabView); startWorkflowMigrationButton.click();