|
30 | 30 | import org.openqa.selenium.WebDriverException;
|
31 | 31 | import org.openqa.selenium.WebElement;
|
32 | 32 |
|
| 33 | +import java.util.Arrays; |
33 | 34 | import java.util.List;
|
34 | 35 | import java.util.Optional;
|
35 | 36 | import java.util.logging.Level;
|
@@ -244,6 +245,19 @@ public String toString() {
|
244 | 245 | };
|
245 | 246 | }
|
246 | 247 |
|
| 248 | + /** |
| 249 | + * An expectation for checking that all elements present on the web page that match the locator |
| 250 | + * are visible. Visibility means that the elements are not only displayed but also have a height |
| 251 | + * and width that is greater than 0. |
| 252 | + * |
| 253 | + * @param elements list of WebElements |
| 254 | + * @return the list of WebElements once they are located |
| 255 | + */ |
| 256 | + public static ExpectedCondition<List<WebElement>> visibilityOfAllElements( |
| 257 | + final WebElement... elements) { |
| 258 | + return visibilityOfAllElements(Arrays.asList(elements)); |
| 259 | + } |
| 260 | + |
247 | 261 | /**
|
248 | 262 | * An expectation for checking that all elements present on the web page that match the locator
|
249 | 263 | * are visible. Visibility means that the elements are not only displayed but also have a height
|
@@ -1332,6 +1346,17 @@ public String toString() {
|
1332 | 1346 | };
|
1333 | 1347 | }
|
1334 | 1348 |
|
| 1349 | + /** |
| 1350 | + * An expectation for checking all elements from given list to be invisible |
| 1351 | + * |
| 1352 | + * @param elements used to check their invisibility |
| 1353 | + * @return Boolean true when all elements are not visible anymore |
| 1354 | + */ |
| 1355 | + public static ExpectedCondition<Boolean> invisibilityOfAllElements( |
| 1356 | + final WebElement... elements) { |
| 1357 | + return invisibilityOfAllElements(Arrays.asList(elements)); |
| 1358 | + } |
| 1359 | + |
1335 | 1360 | /**
|
1336 | 1361 | * An expectation for checking all elements from given list to be invisible
|
1337 | 1362 | *
|
|
0 commit comments