1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.sampleu.main;
17
18 import org.apache.commons.lang.RandomStringUtils;
19 import org.junit.Test;
20 import org.kuali.rice.testtools.selenium.AutomatedFunctionalTestUtils;
21 import org.kuali.rice.testtools.selenium.WebDriverUtils;
22
23
24
25
26 public class TermMaintenanceNewAft extends MainTmplMthdSTNavBase {
27
28
29
30
31
32
33 public static final String BOOKMARK_URL = AutomatedFunctionalTestUtils.PORTAL + "?channelTitle=Term%20Lookup&channelUrl=" + WebDriverUtils.getBaseUrlString()
34 + "/kr-krad/lookup?methodToCall=start&dataObjectClassName=org.kuali.rice.krms.impl.repository.TermBo&returnLocation="
35 + AutomatedFunctionalTestUtils.PORTAL_URL + AutomatedFunctionalTestUtils.HIDE_RETURN_LINK;
36
37 @Override
38 protected String getBookmarkUrl() {
39 return BOOKMARK_URL;
40 }
41
42
43
44
45
46
47 @Override
48 protected String getLinkLocator() {
49 return "Term Lookup";
50 }
51
52 protected void createNewEnterDetails() throws InterruptedException {
53 selectFrameIframePortlet();
54 waitAndClickLinkContainingText("Create New");
55
56 String randomCode = RandomStringUtils.randomAlphabetic(9).toUpperCase();
57 waitAndTypeByName("document.newMaintainableObject.dataObject.description","New Term " + randomCode);
58 waitAndTypeByName("document.newMaintainableObject.dataObject.specificationId", "T1000");
59 waitAndTypeByName("document.newMaintainableObject.dataObject.specification.namespace", "KR_RULE_TEST");
60 waitForProgressLoading();
61 waitForTextPresent("campusSize");
62 waitForTextPresent("java.lang.Integer");
63 waitForElementPresentByXpath("//label[contains(text(),'Specification Description')]/span[contains(text(),'Size in # of students of the campus')]");
64 waitAndTypeByName("document.newMaintainableObject.dataObject.parametersMap[Campus Code]","FakeCampus" + randomCode);
65
66 waitAndClickByXpath("//button[contains(text(),'Submit')]");
67 waitAndClickConfirmSubmitOk();
68 waitForProgressLoading();
69 waitForTextPresent("Document was successfully submitted.", WebDriverUtils.configuredImplicityWait() * 2);
70 waitForTextPresent("FakeCampus" + randomCode);
71 }
72
73 @Test
74 public void testCreateNewTermWithParameterBookmark() throws Exception {
75 createNewEnterDetails();
76 passed();
77 }
78
79 @Test
80 public void testCreateNewTermWithParameterNav() throws Exception {
81 createNewEnterDetails();
82 passed();
83 }
84 }