Skip to content

Commit

Permalink
Remove more unnecessary code
Browse files Browse the repository at this point in the history
  • Loading branch information
matthias-ronge committed Jan 22, 2024
1 parent 5cf4f39 commit 218d20e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ public enum TabIndex {

// system page
TASKMANAGER(0),
INDEXING(2),
MIGRATION(3),
MIGRATION(2),

// user configuration
SETTINGS(0),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<WebDriver> 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<WebElement> 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();
Expand Down

0 comments on commit 218d20e

Please sign in to comment.