
com.onevizion.uitest.api.helper.report.ReportWait Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ui-test-api Show documentation
Show all versions of ui-test-api Show documentation
An API for easily write tests for OneVizion platform
The newest version!
package com.onevizion.uitest.api.helper.report;
import java.util.List;
import org.openqa.selenium.By;
import org.openqa.selenium.StaleElementReferenceException;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.onevizion.uitest.api.SeleniumSettings;
@Component
class ReportWait {
@Autowired
private SeleniumSettings seleniumSettings;
void waitReport() {
new WebDriverWait(seleniumSettings.getWebDriver(), seleniumSettings.getDefaultTimeout())
.withMessage("Waiting for export is failed")
.ignoring(StaleElementReferenceException.class)
.until(webdriver -> {
WebElement panel = webdriver.findElement(By.id("processEventList"));
List processes = panel.findElements(By.className("group_event"));
return !processes.isEmpty();
});
}
void waitReportDone() {
new WebDriverWait(seleniumSettings.getWebDriver(), seleniumSettings.getDefaultTimeout())
.withMessage("Waiting for export done is failed")
.ignoring(StaleElementReferenceException.class)
.until(webdriver -> {
WebElement panel = webdriver.findElement(By.id("processEventList"));
List statuses = panel.findElements(By.className("ie_status"));
for (WebElement status : statuses) {
if ("Executed without Errors".equals(status.getAttribute("textContent"))) {
return true;
}
}
return false;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy