Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,6 +21,7 @@
import org.labkey.remoteapi.SimplePostCommand;
import org.labkey.test.Locator;
import org.labkey.test.Locators;
import org.labkey.test.WebDriverWrapper;
import org.labkey.test.pages.ehr.AnimalHistoryPage;
import org.labkey.test.util.Crawler;
import org.labkey.test.util.DataRegionTable;
Expand All@@ -32,6 +33,7 @@
import org.labkey.test.util.external.labModules.LabModuleHelper;
import org.labkey.test.util.selenium.WebDriverUtils;
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriverException;
import org.openqa.selenium.WebElement;
Expand DownExpand Up@@ -436,6 +438,13 @@ private void validatePageLinks(Set<String> crawledLinks)
{
log("Validating links on " + getURL());

// Wait for DOM to be fully loaded and stable
WebDriverWrapper.waitFor(() -> {
String readyState = (String) ((JavascriptExecutor) getDriver())
.executeScript("return document.readyState");
return "complete".equals(readyState);
}, 5000);

// Find all anchors in the body content area, excluding buttons and those in data regions
List<WebElement> anchors = getDriver().findElements(By.xpath("//div[contains(concat(' ', normalize-space(@class), ' '), ' lk-body-ct ')]//a[not(ancestor::form[@data-region-form]) and not(@role='button') and not(contains(@class, 'labkey-button'))]"));

Expand Down