1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.sampleu.krad.configview;
17
18 import org.kuali.rice.testtools.common.JiraAwareFailable;
19 import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
20 import org.openqa.selenium.By;
21
22
23
24
25 public abstract class HelpAftBase extends WebDriverLegacyITBase {
26
27
28
29
30 public static final String BOOKMARK_URL = "/kr-krad/configuration-test-view-uif-controller?viewId=ConfigurationTestView&methodToCall=start&pageId=ConfigurationTestView-Help-Page";
31 public static final String HELP_FOR_CONFIGURATION_TEST_VIEW_XPATH =
32 "//a[@title='Help for Configuration Test View']";
33
34 @Override
35 protected String getBookmarkUrl() {
36 return BOOKMARK_URL;
37 }
38
39 protected void navigation() throws Exception {
40 waitAndClickKRAD();
41 waitAndClickByXpath(CONFIGURATION_VIEW_XPATH);
42 switchToWindow(CONFIGURATION_VIEW_WINDOW_TITLE);
43 waitAndClickByLinkText("Help");
44 Thread.sleep(5000);
45 }
46
47 protected void testHelpNav(JiraAwareFailable failable) throws Exception {
48 navigation();
49 testViewHelp();
50 testPageHelp();
51 testTooltipHelp();
52 testDisplayOnlyTooltipHelp();
53 testMissingTooltipHelp();
54 passed();
55 }
56
57 protected void testHelpBookmark(JiraAwareFailable failable) throws Exception {
58 testViewHelp();
59 testPageHelp();
60 testTooltipHelp();
61 testDisplayOnlyTooltipHelp();
62 testMissingTooltipHelp();
63 passed();
64 }
65
66
67
68
69
70 protected void testPageHelp() throws Exception {
71
72 fireMouseOverEventByXpath("//a/span[@class='uif-headerText-span']");
73 waitForElementPresent("//div[@class='popover top in']");
74
75
76 switchToWindow("Kuali Portal Index");
77 switchToWindow(CONFIGURATION_VIEW_WINDOW_TITLE);
78 }
79
80
81
82
83 protected void testTooltipHelp() throws Exception {
84
85 if (isElementPresentByXpath("//td[contains(text(),'Sample text for section help - tooltip help')]")) {
86 waitNotVisibleByXpath("//td[contains(text(),'Sample text for section help - tooltip help')]");
87 }
88
89 if (isElementPresentByXpath("//td[contains(text(),'Sample text for field help - label left')]")) {
90 waitNotVisibleByXpath("//td[contains(text(),'Sample text for field help - label left')]");
91 }
92
93 if (isElementPresentByXpath("//td[contains(text(),'Sample text for field help - label right')]")) {
94 waitNotVisibleByXpath("//td[contains(text(),'Sample text for field help - label right')]");
95 }
96
97
98
99
100
101
102 if (isElementPresentByXpath("//td[contains(text(),'Sample text for standalone help widget tooltip which will never be rendered')]")) {
103 waitNotVisibleByXpath("//td[contains(text(),'Sample text for standalone help widget tooltip which will never be rendered')]");
104 }
105
106 if (isElementPresentByXpath("//td[contains(text(),'Sample text for field help - there is also a tooltip on the label but it is overridden by the help tooltip')]")) {
107 waitNotVisibleByXpath("//td[contains(text(),'Sample text for field help - there is also a tooltip on the label but it is overridden by the help tooltip')]");
108 }
109
110 if (isElementPresentByXpath("//td[contains(text(),'Sample text for label tooltip - this will not be rendered as it is overridden by the help tooltip')]")) {
111 waitNotVisibleByXpath("//td[contains(text(),'Sample text for label tooltip - this will not be rendered as it is overridden by the help tooltip')]");
112 }
113
114 if (isElementPresentByXpath("//td[contains(text(),'Sample text for field help - there is also an on-focus tooltip')]")) {
115 waitNotVisibleByXpath("//td[contains(text(),'Sample text for field help - there is also an on-focus tooltip')]");
116 }
117
118 if (isElementPresentByXpath("//td[contains(text(),'Sample text for on-focus event tooltip')]")) {
119 waitNotVisibleByXpath("//td[contains(text(),'Sample text for on-focus event tooltip')]");
120 }
121
122 if (isElementPresentByXpath("//td[contains(text(),'Sample text for check box help')]")) {
123 waitNotVisibleByXpath("//td[contains(text(),'Sample text for check box help')]");
124 }
125
126
127 fireMouseOverEventByXpath("//section[@id='ConfigurationTestView-Help-Section1']/header/h3[@class='uif-headerText']");
128 waitForElementPresentByXpath("//div[@class='popover top in']");
129
130
131 assertFalse(isElementPresent("#ConfigurationTestView-Help-Section1 input.uif-helpImage"));
132
133
134 fireMouseOverEventByXpath("//label[@id='field-label-left_label']");
135 waitForElementPresentByXpath("//div[@class='popover top in']");
136
137
138 fireMouseOverEventByXpath("//label[@id='field-label-right_label']");
139 waitForElementPresentByXpath("//div[@class='popover top in']");
140
141
142 fireMouseOverEventByXpath("//label[@id='field-label-top_label']");
143 waitForElementPresentByXpath("//div[@class='popover top in']");
144
145
146 assertFalse(isElementPresentByXpath("//*[@id='standalone-help-not-rendered']"));
147
148
149 fireMouseOverEventByXpath("//label[@id='override-tooltip_label']");
150 waitForElementPresentByXpath("//div[@class='popover top in']");
151 if (isElementPresentByXpath("//td[contains(text(),'Sample text for label tooltip - this will not be rendered as it is overridden by the help tooltip')]")) {
152 waitNotVisibleByXpath("//td[contains(text(),'Sample text for label tooltip - this will not be rendered as it is overridden by the help tooltip')]");
153 }
154
155
156 fireMouseOverEventByXpath("//input[@id='on-focus-tooltip_control']");
157 waitForElementPresentByXpath("//div[@class='popover top in']");
158 fireMouseOverEventByXpath("//label[@id='on-focus-tooltip_label']");
159 waitForElementPresentByXpath("//div[@class='popover top in']");
160
161
162 fireMouseOverEventByXpath("//label[@id='checkbox_label']");
163 waitForElementPresentByXpath("//div[@class='popover top in']");
164 }
165
166
167
168
169 protected void testDisplayOnlyTooltipHelp() throws Exception {
170
171
172 fireMouseOverEventByXpath("//section[@data-parent='ConfigurationTestView-Help-Section1']/header/h4");
173 waitForElementPresentByXpath("//td[contains(text(),'Sample text for sub-section help')]");
174
175
176 fireMouseOverEventByXpath("//label[@for='display-field_control']");
177 waitForElementPresentByXpath("//td[contains(text(),'Sample text for read only field help')]");
178 }
179
180
181
182
183 protected void testMissingTooltipHelp() throws Exception {
184
185
186 fireMouseOverEventByXpath("//section[@id='ConfigurationTestView-Help-Section2']/div");
187 assertFalse(isElementPresentByXpath("//div[@class='jquerybubblepopup jquerybubblepopup-black' and @style='opacity: 0; top: 627px; left: 2px; position: absolute; display: block;']"));
188
189
190 fireMouseOverEventByXpath("//label[@id='missing-tooltip-help_label']");
191 assertFalse(isElementPresentByXpath("//div[@class='jquerybubblepopup jquerybubblepopup-black' and @style='opacity: 0; top: 627px; left: 2px; position: absolute; display: block;']"));
192 }
193
194
195
196
197 protected void testViewHelp() throws Exception {
198
199 fireEvent("field102", "blur");
200 fireMouseOverEventByXpath("//label[@id='field-label-left_label']");
201 waitForElementPresent("//div[@class='popover top in']");
202
203
204 switchToWindow("Kuali Portal Index");
205 switchToWindow(CONFIGURATION_VIEW_WINDOW_TITLE);
206 }
207 }