|
9 | 9 | import org.labkey.test.components.Component; |
10 | 10 | import org.labkey.test.components.WebDriverComponent; |
11 | 11 | import org.labkey.test.util.TestLogger; |
| 12 | +import org.openqa.selenium.By; |
12 | 13 | import org.openqa.selenium.WebDriver; |
13 | 14 | import org.openqa.selenium.WebElement; |
14 | 15 | import org.openqa.selenium.support.ui.ExpectedConditions; |
@@ -174,23 +175,39 @@ public ProductMenu clickFolderItem(String folderName) |
174 | 175 | public void goToFolderDashboard(String folderName) |
175 | 176 | { |
176 | 177 | clickFolderItem(folderName); |
| 178 | + getWrapper().mouseOver(elementCache().activeDashboardIcon); |
177 | 179 | clickNavLink(elementCache().activeDashboardIcon); |
178 | 180 | } |
179 | 181 |
|
| 182 | + // Interactions with icon elements on the page to catch GitHub Issue 1146. |
180 | 183 | public int getDashboardIconCount() |
181 | 184 | { |
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(); |
183 | 192 | } |
184 | 193 |
|
185 | 194 | public void goToFolderAdministration(String folderName) |
186 | 195 | { |
187 | 196 | clickFolderItem(folderName); |
| 197 | + getWrapper().mouseOver(elementCache().activeAdministrationIcon); |
188 | 198 | clickNavLink(elementCache().activeAdministrationIcon); |
189 | 199 | } |
190 | 200 |
|
| 201 | + // Interactions with icon elements on the page to catch GitHub Issue 1146. |
191 | 202 | public int getAdministrationIconCount() |
192 | 203 | { |
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(); |
194 | 211 | } |
195 | 212 |
|
196 | 213 | public String getButtonTitle() |
|
0 commit comments