Skip to content

Commit 8790856

Browse files
committed
tests fixed to catch something like issue 1146
1 parent dc35091 commit 8790856

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

src/org/labkey/test/components/ui/navigation/ProductMenu.java

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import org.labkey.test.components.Component;
1010
import org.labkey.test.components.WebDriverComponent;
1111
import org.labkey.test.util.TestLogger;
12+
import org.openqa.selenium.By;
1213
import org.openqa.selenium.WebDriver;
1314
import org.openqa.selenium.WebElement;
1415
import org.openqa.selenium.support.ui.ExpectedConditions;
@@ -174,23 +175,39 @@ public ProductMenu clickFolderItem(String folderName)
174175
public void goToFolderDashboard(String folderName)
175176
{
176177
clickFolderItem(folderName);
178+
getWrapper().mouseOver(elementCache().activeDashboardIcon);
177179
clickNavLink(elementCache().activeDashboardIcon);
178180
}
179181

182+
// Interactions with icon elements on the page to catch GitHub Issue 1146.
180183
public int getDashboardIconCount()
181184
{
182-
return elementCache().dashboardIconLoc.findElements(elementCache().menuContent).size();
185+
List<WebElement> dashboardIcons = elementCache().dashboardIconLoc.findElements(elementCache().menuContent);
186+
for (WebElement dashboardIcon : dashboardIcons)
187+
{
188+
getWrapper().mouseOver(dashboardIcon.findElement(By.xpath("./ancestor::li[1]")));
189+
getWrapper().mouseOver(dashboardIcon);
190+
}
191+
return dashboardIcons.size();
183192
}
184193

185194
public void goToFolderAdministration(String folderName)
186195
{
187196
clickFolderItem(folderName);
197+
getWrapper().mouseOver(elementCache().activeAdministrationIcon);
188198
clickNavLink(elementCache().activeAdministrationIcon);
189199
}
190200

201+
// Interactions with icon elements on the page to catch GitHub Issue 1146.
191202
public int getAdministrationIconCount()
192203
{
193-
return elementCache().administrationIconLoc.findElements(elementCache().menuContent).size();
204+
List<WebElement> adminIcons = elementCache().administrationIconLoc.findElements(elementCache().menuContent);
205+
for (WebElement adminIcon : adminIcons)
206+
{
207+
getWrapper().mouseOver(adminIcon.findElement(By.xpath("./ancestor::li[1]")));
208+
getWrapper().mouseOver(adminIcon);
209+
}
210+
return adminIcons.size();
194211
}
195212

196213
public String getButtonTitle()

0 commit comments

Comments
 (0)