1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.samplu.krad.configview;
17
18 import edu.samplu.common.UpgradedSeleniumITBase;
19 import org.junit.Test;
20
21 import static org.junit.Assert.*;
22
23
24
25
26
27
28
29
30
31
32
33
34 public class HelpIT extends UpgradedSeleniumITBase {
35
36
37
38 private long HELP_WINDOW_LOAD_DELAY = 3000;
39
40 @Override
41 public String getTestUrl() {
42 return "/kr-krad/configuration-test-view-uif-controller?viewId=ConfigurationTestView-Help&methodToCall=start";
43 }
44
45
46
47
48 @Test
49 public void testViewHelp() throws Exception {
50
51 mouseOver("css=h1 .uif-headerText-span");
52 assertEquals("Sample text for view help", getText("css=td.jquerybubblepopup-innerHtml"));
53
54
55 waitAndClick("css=input[title=\"Help for Configuration Test View - Help\"]");
56
57
58 Thread.sleep(5000);
59 selectWindow("Open Source Software | www.kuali.org");
60 Thread.sleep(5000);
61 assertEquals("http://www.kuali.org/?view", getLocation());
62
63 selectWindow("Kuali :: Configuration Test View - Help");
64 }
65
66
67
68
69 @Test
70 public void testPageHelp() throws Exception {
71
72 mouseOver("css=h2 .uif-headerText-span");
73 assertEquals("Sample text for page help", getText("css=td.jquerybubblepopup-innerHtml"));
74
75
76 waitAndClick("css=input[title=\"Help for Help Page\"]");
77
78
79 Thread.sleep(5000);
80 selectWindow("Open Source Software | www.kuali.org");
81 Thread.sleep(5000);
82 assertEquals("http://www.kuali.org/?page", getLocation());
83
84 selectWindow("Kuali :: Configuration Test View - Help");
85 }
86
87
88
89
90 @Test
91 public void testTooltipHelp() throws Exception {
92
93 if (isElementPresent("css=td:contains(\"Sample text for section help - tooltip help\")")) {
94 assertFalse(isVisible("css=td:contains(\"Sample text for section help - tooltip help\")"));
95 }
96 if (isElementPresent("css=td:contains(\"Sample text for field help - label left\")")) {
97 assertFalse(isVisible("css=td:contains(\"Sample text for field help - label left\")"));
98 }
99 if (isElementPresent("css=td:contains(\"Sample text for field help - label right\")")) {
100 assertFalse(isVisible("css=td:contains(\"Sample text for field help - label right\")"));
101 }
102 if (isElementPresent("css=td:contains(\"Sample text for field help - label top\")")) {
103 assertFalse(isVisible("css=td:contains(\"Sample text for field help - label top\")"));
104 }
105 if (isElementPresent("css=td:contains(\"Sample text for standalone help widget tooltip which will never be rendered\")")) {
106 assertFalse(isVisible("css=td:contains(\"Sample text for standalone help widget tooltip which will never be rendered\")"));
107 }
108 if (isElementPresent("css=td:contains(\"Sample text for field help - there is also a tooltip on the label but it is overridden by the help tooltip\")")) {
109 assertFalse(isVisible("css=td:contains(\"Sample text for field help - there is also a tooltip on the label but it is overridden by the help tooltip\")"));
110 }
111 if (isElementPresent("css=td:contains(\"Sample text for label tooltip - this will not be rendered as it is overridden by the help tooltip\")")) {
112 assertFalse(isVisible("css=td:contains(\"Sample text for label tooltip - this will not be rendered as it is overridden by the help tooltip\")"));
113 }
114 if (isElementPresent("css=td:contains(\"Sample text for field help - there is also an on-focus tooltip\")")) {
115 assertFalse(isVisible("css=td:contains(\"Sample text for field help - there is also an on-focus tooltip\")"));
116 }
117 if (isElementPresent("css=td:contains(\"Sample text for on-focus event tooltip\")")) {
118 assertFalse(isVisible("css=td:contains(\"Sample text for on-focus event tooltip\")"));
119 }
120 if (isElementPresent("css=td:contains(\"Sample text for check box help\")")) {
121 assertFalse(isVisible("css=td:contains(\"Sample text for check box help\")"));
122 }
123
124
125 mouseOver("css=#ConfigurationTestView-Help-Section1 h3 .uif-headerText-span");
126 assertTrue(isVisible("css=td:contains(\"Sample text for section help - tooltip help\")"));
127 mouseOut("css=#ConfigurationTestView-Help-Section1 h3 .uif-headerText-span");
128 assertFalse(isVisible("css=td:contains(\"Sample text for section help - tooltip help\")"));
129
130
131 assertFalse(isElementPresent("css=#ConfigurationTestView-Help-Section1 input.uif-helpImage"));
132
133
134 mouseOver("id=field-label-left_label");
135 assertTrue(isVisible("css=td:contains(\"Sample text for field help - label left\")"));
136 mouseOut("id=field-label-left_label");
137 assertFalse(isVisible("css=td:contains(\"Sample text for field help - label left\")"));
138
139
140 mouseOver("id=field-label-right_label");
141 assertTrue(isVisible("css=td:contains(\"Sample text for field help - label righ\")"));
142 mouseOut("id=field-label-right_label");
143 assertFalse(isVisible("css=td:contains(\"Sample text for field help - label right\")"));
144
145
146 mouseOver("id=field-label-top_label");
147 assertTrue(isVisible("css=td:contains(\"Sample text for field help - label top\")"));
148 mouseOut("id=field-label-top_label");
149 assertFalse(isVisible("css=td:contains(\"Sample text for field help - label top\")"));
150
151
152 assertFalse(isElementPresent("id=standalone-help-not-rendered"));
153
154
155 mouseOver("id=override-tooltip_label");
156 assertTrue(isVisible("css=td:contains(\"Sample text for field help - there is also a tooltip on the label but it is overridden by the help tooltip\")"));
157 if (isElementPresent("css=td:contains(\"Sample text for label tooltip - this will not be rendered as it is overridden by the help tooltip\")")) {
158 assertFalse(isVisible("css=td:contains(\"Sample text for label tooltip - this will not be rendered as it is overridden by the help tooltip\")"));
159 }
160 mouseOut("id=override-tooltip_label");
161 assertFalse(isVisible("css=td:contains(\"Sample text for field help - there is also a tooltip on the label but it is overridden by the help tooltip\")"));
162
163
164 mouseOver("id=on-focus-tooltip_control");
165 assertTrue(isVisible("css=td:contains(\"Sample text for on-focus event tooltip\")"));
166 mouseOver("id=on-focus-tooltip_label");
167 assertTrue(isVisible("css=td:contains(\"Sample text for field help - there is also an on-focus tooltip\")"));
168 mouseOut("id=on-focus-tooltip_control");
169 mouseOut("id=on-focus-tooltip_label");
170 assertFalse(isVisible("css=td:contains(\"Sample text for field help - there is also an on-focus tooltip\")"));
171 assertFalse(isVisible("css=td:contains(\"Sample text for on-focus event tooltip\")"));
172
173
174 mouseOver("id=checkbox_label");
175 assertTrue(isVisible("css=td:contains(\"Sample text for check box help\")"));
176 mouseOut("id=checkbox_label");
177 assertFalse(isVisible("css=td:contains(\"Sample text for check box help\")"));
178 }
179
180
181
182
183 @Test
184 public void testDisplayOnlyTooltipHelp() throws Exception {
185
186 if (isElementPresent("css=td:contains(\"Sample text for sub-section help\")")) {
187 assertFalse(isVisible("css=td:contains(\"Sample text for sub-section help\")"));
188 }
189 if (isElementPresent("css=td:contains(\"Sample text for read only field help\")")) {
190 assertFalse(isVisible("css=td:contains(\"Sample text for read only field help\")"));
191 }
192
193
194 mouseOver("css=h4 .uif-headerText-span");
195 assertTrue(isVisible("css=td:contains(\"Sample text for sub-section help\")"));
196 mouseOut("css=h4 .uif-headerText-span");
197 assertFalse(isVisible("css=td:contains(\"Sample text for sub-section help\")"));
198
199
200 mouseOver("css=#display-field label");
201 assertTrue(isVisible("css=td:contains(\"Sample text for read only field help\")"));
202 mouseOut("css=#display-field label");
203 assertFalse(isVisible("css=td:contains(\"Sample text for read only field help\")"));
204 }
205
206
207
208
209 @Test
210 public void testMissingTooltipHelp() throws Exception {
211
212 assertFalse(isElementPresent("css=.jquerybubblepopup"));
213
214
215 assertFalse(isElementPresent("css=#ConfigurationTestView-Help-Section2 input.uif-helpImage"));
216
217
218 mouseOver("css=#ConfigurationTestView-Help-Section2 h3 .uif-headerText-span");
219 assertFalse(isElementPresent("css=.jquerybubblepopup"));
220 mouseOut("css=#ConfigurationTestView-Help-Section1 h3 .uif-headerText-span");
221 assertFalse(isElementPresent("css=.jquerybubblepopup"));
222
223
224 mouseOver("id=missing-tooltip-help_label");
225 assertFalse(isElementPresent("css=.jquerybubblepopup"));
226 mouseOut("id=missing-tooltip-help_label");
227 assertFalse(isElementPresent("css=.jquerybubblepopup"));
228 }
229 }