Skip to content

Commit

Permalink
Merge pull request kitodo#5892 from effective-webwork/listing-st
Browse files Browse the repository at this point in the history
Fix Listing ST
  • Loading branch information
solth authored Jan 24, 2024
2 parents e9cddfc + 29a4cd5 commit 259bfa9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,10 @@ public void createNewProcess() throws Exception {

public List<String> getProjectDetails() {
int index = triggerRowToggle(projectsTable, "First project");
WebElement detailsTable = Browser.getDriver()
.findElement(By.id(PROJECTS_TABLE + ":" + index + ":projectDetailTable"));
String elementId = PROJECTS_TABLE + ":" + index + ":projectDetailTable";
await("Wait for project table row to be expanded").atMost(3, TimeUnit.SECONDS)
.untilAsserted(() -> assertTrue(Browser.getDriver().findElement(By.id(elementId)).isDisplayed()));
WebElement detailsTable = Browser.getDriver().findElement(By.id(elementId));
return getTableDataByColumn(detailsTable, 1);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
package org.kitodo.selenium.testframework.pages;

import static org.awaitility.Awaitility.await;
import static org.junit.Assert.assertTrue;
import static org.kitodo.selenium.testframework.Browser.getRowsOfTable;
import static org.kitodo.selenium.testframework.Browser.getTableDataByColumn;
import static org.kitodo.selenium.testframework.Browser.scrollWebElementIntoView;
Expand Down Expand Up @@ -79,12 +80,16 @@ public TasksPage goTo() throws Exception {

public List<String> getTaskDetails() {
int index = triggerRowToggle(taskTable, "Progress");
WebElement detailsTable1 = Browser.getDriver()
.findElementById(TASK_TABLE + ":" + index + ":taskDetailTableFirst");
WebElement detailsTable2 = Browser.getDriver()
.findElementById(TASK_TABLE + ":" + index + ":taskDetailTableSecond");
List<String> taskDetails = getTableDataByColumn(detailsTable1, 1);
taskDetails.addAll(getTableDataByColumn(detailsTable2, 1));
String firstElementId = TASK_TABLE + ":" + index + ":taskDetailTableFirst";
String secondElementId = TASK_TABLE + ":" + index + ":taskDetailTableSecond";
await("Wait for first task details to become visible").atMost(3, TimeUnit.SECONDS)
.untilAsserted(() -> assertTrue(Browser.getDriver().findElement(By.id(firstElementId)).isDisplayed()));
WebElement firstDetails = Browser.getDriver().findElementById(firstElementId);
List<String> taskDetails = getTableDataByColumn(firstDetails, 1);
await("Wait for second task details to become visible").atMost(3, TimeUnit.SECONDS)
.untilAsserted(() -> assertTrue(Browser.getDriver().findElement(By.id(secondElementId)).isDisplayed()));
WebElement secondDetails = Browser.getDriver().findElementById(secondElementId);
taskDetails.addAll(getTableDataByColumn(secondDetails, 1));
return taskDetails;
}

Expand Down

0 comments on commit 259bfa9

Please sign in to comment.