org.onap migration
[vid.git] / vid-automation / src / main / java / vid / automation / test / infra / Exists.java
1 package vid.automation.test.infra;
2
3 import org.openqa.selenium.NoSuchElementException;
4 import vid.automation.test.Constants;
5
6 public class Exists {
7     public static boolean byId(String id) {
8         return Get.byId(id) != null;
9     }
10
11     public static boolean byTestId(String testId) {
12         return Get.byTestId(testId) != null;
13     }
14
15     public static boolean byClass(String className) {
16         return Get.byClass(className) != null;
17     }
18
19     public static boolean byClassAndText(String className, String text) {
20         return Get.byClassAndText(className, text) != null;
21     }
22
23     public static boolean byCssSelectorAndText(String css, String text) {
24         return Get.byCssSelectorAndText(css, text) != null;
25     }
26
27     public static boolean modal() {
28         try {
29             return Get.byCssSelector(Constants.Modals.modalClass) != null;
30         } catch (NoSuchElementException exception) {
31             return false;
32         }
33     }
34 }