1   
2   
3   
4   
5   
6   
7   
8   
9   
10  
11  
12  
13  
14  
15  
16  package edu.sampleu.admin;
17  
18  import org.kuali.rice.testtools.selenium.AutomatedFunctionalTestUtils;
19  import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
20  import org.junit.Test;
21  import org.kuali.rice.krad.util.KRADConstants;
22  
23  
24  
25  
26  
27  
28  public class ParameterEnableFieldLevelHelpIndAft extends WebDriverLegacyITBase {
29  
30      @Override
31      protected String getBookmarkUrl() {
32          return AutomatedFunctionalTestUtils.PORTAL;
33      }
34  
35      @Override
36      protected void navigate() throws Exception {
37          waitAndClickAdministration();
38          waitForPageToLoad();
39      }
40  
41      
42  
43  
44  
45  
46  
47      @Test
48      public void testEnableFieldLevelHelpIndParameterNav() throws Exception {
49          setParameter(KRADConstants.SystemGroupParameterNames.ENABLE_FIELD_LEVEL_HELP_IND, "Y");
50  
51          waitAndClickByLinkText("Person");
52          waitForPageToLoad();
53          selectFrameIframePortlet();
54          assertTrue("The help field did not appear", isElementPresent("img[alt='[Help]Principal Name']"));
55  
56          setParameter(KRADConstants.SystemGroupParameterNames.ENABLE_FIELD_LEVEL_HELP_IND, "N");
57  
58          waitAndClickByLinkText("Person");
59          waitForPageToLoad();
60          selectFrameIframePortlet();
61          assertFalse("The help field appeared", isElementPresent("img[alt='[Help]Principal Name']"));
62  
63          passed();
64      }
65  
66      private void setParameter(String parameterName, String parameterValue) throws Exception {
67          selectTopFrame();
68          waitAndClickAdministration();
69          waitAndClickByLinkText("Parameter");
70  
71          selectFrameIframePortlet();
72          waitAndType("input#name", parameterName);
73          waitAndClickSearch();
74          waitAndClickByLinkText(EDIT_LINK_TEXT);
75  
76          waitAndTypeByXpath(DOC_DESCRIPTION_XPATH, "Setting Field Level Help Indicator to " + parameterValue);
77          clearTextByXpath("//textarea[@id='document.newMaintainableObject.value']");
78          waitAndTypeByXpath("//textarea[@id='document.newMaintainableObject.value']", parameterValue);
79          waitAndClickByName(BLANKET_APPROVE_NAME);
80      }
81  
82  
83  }