1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.sampleu.admin;
17
18 import org.junit.Test;
19 import org.kuali.rice.testtools.selenium.AutomatedFunctionalTestUtils;
20 import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
21 import org.kuali.rice.testtools.selenium.WebDriverUtils;
22
23
24
25
26
27
28 public class ComponentAft extends WebDriverLegacyITBase {
29
30 String docId;
31 String componentCode;
32 String componentName;
33
34
35
36
37 public static final String FOR_TEST_MESSAGE = " for Component Parameter";
38
39
40
41
42
43
44 public static final String BOOKMARK_URL = AutomatedFunctionalTestUtils.PORTAL + "?channelTitle=Component&channelUrl=" + WebDriverUtils
45 .getBaseUrlString() +"/kr/lookup.do?methodToCall=start&businessObjectClassName=org.kuali.rice.coreservice.impl.component.ComponentBo&docFormKey=88888888&returnLocation=" +
46 AutomatedFunctionalTestUtils.PORTAL_URL + "&hideReturnLink=true";
47
48 @Override
49 protected String getBookmarkUrl() {
50 return BOOKMARK_URL;
51 }
52
53 protected void navigate() throws InterruptedException {
54 waitAndClickAdministration();
55 waitForTitleToEqualKualiPortalIndex();
56 checkForIncidentReport("Component");
57 selectFrameIframePortlet();
58 waitAndClickByLinkText("Component");
59
60 checkForIncidentReport("Component");
61 }
62
63 @Override
64 protected void createNewEnterDetails() throws InterruptedException {
65 waitAndTypeByName("document.documentHeader.documentDescription", "Adding Test Component");
66 selectOptionByName("document.newMaintainableObject.namespaceCode", "KR-IDM");
67 waitAndTypeByName("document.newMaintainableObject.code", componentCode);
68 waitAndTypeByName("document.newMaintainableObject.name", componentName);
69 checkByName("document.newMaintainableObject.active");
70 }
71
72 protected void testComponentCreateNewCancel() throws Exception {
73 waitAndCreateNew();
74 testCancelConfirmation();
75 passed();
76 }
77
78 protected void testComponentParameter() throws Exception {
79
80 componentName = "TestName" + AutomatedFunctionalTestUtils.createUniqueDtsPlusTwoRandomChars();
81 componentCode = "TestCode" + AutomatedFunctionalTestUtils.createUniqueDtsPlusTwoRandomChars();
82 docId = createNewTemplateMethod();
83
84
85 navigate();
86 testLookUpComponent(docId, componentName, componentCode);
87
88
89 testEditComponent(docId, componentName, componentCode);
90
91
92 navigate();
93 testVerifyEditedComponent(docId, componentName, componentCode);
94
95
96 testCopyComponent(docId, componentName + "copy", componentCode + "copy");
97
98
99 navigate();
100 testVerifyCopyComponent(docId, componentName + "copy", componentCode + "copy");
101 passed();
102 }
103
104 @Test
105 public void testCreateNewCancelComponentBookmark() throws Exception {
106 testComponentCreateNewCancel();
107 }
108
109 @Test
110 public void testComponentCreateNewCancelComponentNav() throws Exception {
111 testComponentCreateNewCancel();
112 }
113
114 @Test
115 public void testComponentParameterBookmark() throws Exception {
116 testComponentParameter();
117 }
118
119 @Test
120 public void testComponentParameterNav() throws Exception {
121 testComponentParameter();
122 }
123 }