1 /**
2 * Copyright 2005-2013 The Kuali Foundation
3 *
4 * Licensed under the Educational Community License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.opensource.org/licenses/ecl2.php
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package edu.samplu.krad.configview;
17
18 import edu.samplu.common.ITUtil;
19 import edu.samplu.common.WebDriverLegacyITBase;
20
21 import org.junit.Test;
22
23 /**
24 * Test the help widget
25 *
26 * <p>
27 * Selenium RC does not allow us to test the external help popup windows due to an error on
28 * JavaScrips window.close method when selenium is running. To test the external help we use the
29 * {@link HelpWDIT2} test which utilizes WebDriver. Unfortunately due to a WebDriver bug/feature we
30 * can't test the tooltip help there.
31 * </p>
32 *
33 * @author Kuali Rice Team (rice.collab@kuali.org)
34 */
35 public class HelpNavIT extends WebDriverLegacyITBase {
36
37 // Delay in milliseconds used to allow the help window reload the new help page.
38 // waitForPopUp will not work since the window already exists.
39 // private long HELP_WINDOW_LOAD_DELAY = 3000;
40
41 @Override
42 public String getTestUrl() {
43 return ITUtil.PORTAL;
44 }
45
46 /**
47 * Test the tooltip and external help on the view
48 */
49 @Test
50 public void testViewHelp() throws Exception {
51 navigateToHelp();
52 super.testViewHelp();
53 passed();
54 }
55
56 /**
57 * Test the tooltip and external help on the page
58 */
59 @Test
60 public void testPageHelp() throws Exception {
61 navigateToHelp();
62 super.testPageHelp();
63 passed();
64 }
65
66 /**
67 * Test the tooltip help on the section and fields
68 */
69 @Test
70 public void testTooltipHelp() throws Exception {
71 navigateToHelp();
72 super.testTooltipHelp();
73 passed();
74 }
75
76 /**
77 * Test the tooltip help on the sub-section and fields that are display only
78 */
79 @Test
80 public void testDisplayOnlyTooltipHelp() throws Exception {
81 navigateToHelp();
82 super.testDisplayOnlyTooltipHelp();
83 passed();
84 }
85
86 /**
87 * Test the tooltip help on the section and fields with no content
88 */
89 @Test
90 public void testMissingTooltipHelp() throws Exception {
91 navigateToHelp();
92 super.testMissingTooltipHelp();
93 passed();
94 }
95
96 private void navigateToHelp() throws Exception
97 {
98 waitAndClickKRAD();
99 waitAndClickByXpath(CONFIGURATION_VIEW_XPATH);
100 switchToWindow(CONFIGURATION_VIEW_WINDOW_TITLE);
101 waitAndClickByLinkText("Help");
102 Thread.sleep(5000);
103 selectFrameIframePortlet();
104 }
105 }