View Javadoc

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  
17  package edu.samplu.krad.configview;
18  
19  import edu.samplu.common.ITUtil;
20  import edu.samplu.common.WebDriverLegacyITBase;
21  
22  import org.junit.Test;
23  
24  /**
25   * Test the help widget
26   * 
27   * @author Kuali Rice Team (rice.collab@kuali.org)
28   */
29  public class HelpNavIT2 extends WebDriverLegacyITBase {
30  
31      /**
32       * URL for the Configuration Test View - Help
33       * 
34       * <p>
35       * Due to a WebDriver bug (feature?) the tooltips can not be tested with WebDriver.
36       * {@link HelpWDIT} is being used to test help tooltips.
37       * </p>
38       * 
39       * @see edu.samplu.common.WebDriverITBase#getTestUrl()
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 testViewHelp2() throws Exception {
51          navigateToHelp();
52          super.testViewHelp2();
53          passed();
54      }
55  
56      /**
57       * Test the external help on the section and fields
58       */
59      @Test
60      public void testExternalHelp2() throws Exception {
61          navigateToHelp();
62          super.testExternalHelp2();
63          passed();
64      }
65  
66      /**
67       * Test the external help on the sub-section and display only fields
68       */
69      @Test
70      public void testDisplayOnlyExternalHelp2() throws Exception {
71          navigateToHelp();
72          super.testDisplayOnlyExternalHelp2();
73          passed();
74      }
75  
76      /**
77       * Test the external help on the section and fields with missing help URL
78       */
79      @Test
80      public void testMissingExternalHelp2() throws Exception {
81          navigateToHelp();
82          super.testMissingExternalHelp2();
83          passed();
84      }
85  
86      private void navigateToHelp() throws Exception
87      {
88          waitAndClickKRAD();
89          waitAndClickByXpath(CONFIGURATION_VIEW_XPATH);
90          switchToWindow(CONFIGURATION_VIEW_WINDOW_TITLE);
91          waitAndClickByLinkText("Help");
92          Thread.sleep(5000);
93          selectFrameIframePortlet();
94      }
95  }