1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.testtools.selenium;
17
18 import org.kuali.rice.testtools.common.JiraAwareFailable;
19 import org.openqa.selenium.WebDriver;
20
21
22
23
24
25
26
27 public class JiraAwareWebDriverUtils {
28
29
30
31
32
33
34
35 public static void assertFalse(boolean booleanToAssertFalse, JiraAwareFailable failable) {
36 if (booleanToAssertFalse) {
37 failable.jiraAwareFail("expected false, but was true");
38 }
39 }
40
41
42
43
44
45
46
47 public static void assertFalse(String message, boolean booleanToAssertFalse, JiraAwareFailable failable) {
48 if (booleanToAssertFalse) {
49 failable.jiraAwareFail(message + " expected false, but was true");
50 }
51 }
52
53
54
55
56
57
58 public static void assertTrue(boolean booleanToAssertTrue, JiraAwareFailable failable) {
59 if (!booleanToAssertTrue) {
60 failable.jiraAwareFail("expected true, but was false");
61 }
62 }
63
64
65
66
67
68
69
70
71 public static void assertTrue(String message, boolean booleanToAssertTrue, JiraAwareFailable failable) {
72 if (!booleanToAssertTrue) {
73 failable.jiraAwareFail(message + " expected true, but was false");
74 }
75 }
76
77
78
79
80
81
82
83
84
85
86 public static void assertButtonDisabledByText(WebDriver driver, String buttonText, JiraAwareFailable failable) {
87 WebDriverUtils.jGrowl(driver, "Assert", false, "Assert " + buttonText + " button is disabled");
88 if (WebDriverUtils.findButtonByText(driver, buttonText).isEnabled()) {
89 failable.jiraAwareFail(buttonText + " button is not disabled");
90 }
91 }
92
93
94
95
96
97
98
99
100
101
102 public static void assertButtonEnabledByText(WebDriver driver, String buttonText, JiraAwareFailable failable) {
103 WebDriverUtils.jGrowl(driver, "Assert", false, "Assert " + buttonText + " button is enabled");
104 if (!WebDriverUtils.findButtonByText(driver, buttonText).isEnabled()) {
105 failable.jiraAwareFail(buttonText + " button is not enabled");
106 }
107 }
108 }