Skip to content

Commit

Permalink
Attempt to fix JBrowseTest
Browse files Browse the repository at this point in the history
  • Loading branch information
bbimber committed Nov 4, 2024
1 parent 3252d13 commit 1b06c8e
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,14 @@ public static void waitForJBrowseToLoad(BaseWebDriverTest test)

public static long getTotalVariantFeatures(BaseWebDriverTest test)
{
final int winWidth = test.executeScript("window.outerWidth", Integer.class);
final int winHeight = test.executeScript("window.outerHeight", Integer.class);
Locator l = Locator.tagWithAttribute("svg", "data-testid", "svgfeatures").append(Locator.tag("polygon"));
try
{
// NOTE: JBrowse renders features using multiple blocks per track, and these tracks can redundantly render identical features on top of one another.
// Counting unique locations is indirect, but should result in unique features
return Locator.findElements(test.getDriver(), l).stream().filter(WebElement::isDisplayed).map(WebElement::getLocation).distinct().count();
return Locator.findElements(test.getDriver(), l).stream().filter(WebElement::isDisplayed).map(WebElement::getRect).distinct().filter(rec -> rec.x > 0 & (rec.x + rec.width) <= winWidth & rec.y > 0 & (rec.y + rec.height) <= winHeight).count();
}
catch (StaleElementReferenceException e)
{
Expand Down

0 comments on commit 1b06c8e

Please sign in to comment.