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