1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.sampleu.kim.api.location;
17
18 import edu.sampleu.admin.AdminTmplMthdAftNavBlanketAppBase;
19 import org.junit.Test;
20 import org.kuali.rice.testtools.selenium.AutomatedFunctionalTestUtils;
21 import org.kuali.rice.testtools.selenium.WebDriverUtils;
22
23 import java.util.Arrays;
24 import java.util.List;
25
26
27
28
29 public class LocationStateAft extends AdminTmplMthdAftNavBlanketAppBase {
30
31 public static final List<String> STATE_CODES = Arrays.asList(
32 new String[]{"AK", "AL", "AR", "AS", "AZ", "CA", "CO", "CT", "DC", "DE", "FL", "GA", "GU", "HI", "IA", "ID",
33 "IL", "IN", "KS", "KY", "LA", "MA", "MD", "ME", "MH", "MI", "MN", "MO", "MS", "MT", "NC", "ND",
34 "NE", "NH", "NJ", "NM", "NV", "NY", "OH", "OK", "OR", "PA", "PR", "PW", "RI", "SC", "SD", "TN",
35 "TX", "UT", "VA", "VI", "VT", "WA", "WI", "WV", "WY"});
36
37
38
39
40
41
42 public static final String BOOKMARK_URL = AutomatedFunctionalTestUtils.PORTAL + "?channelTitle=State&channelUrl="
43 + WebDriverUtils.getBaseUrlString() + AutomatedFunctionalTestUtils.KNS_LOOKUP_METHOD +
44 "org.kuali.rice.location.impl.state.StateBo&docFormKey=88888888&returnLocation=" +
45 AutomatedFunctionalTestUtils.PORTAL_URL + AutomatedFunctionalTestUtils.HIDE_RETURN_LINK + AutomatedFunctionalTestUtils.SHOW_MAINTENANCE_LINKS;
46
47 @Override
48 protected String getBookmarkUrl() {
49 return BOOKMARK_URL;
50 }
51
52
53
54
55
56
57 @Override
58 protected String getLinkLocator() {
59 return "State";
60 }
61
62 protected void createNewEnterDetails() throws InterruptedException {
63 inputDetails();
64
65 jiraAwareTypeByName("document.newMaintainableObject.countryCode", "US");
66 }
67
68 private void inputDetails() throws InterruptedException {
69
70 getDescriptionUnique();
71 while (STATE_CODES.contains(uniqueString.substring(5, 7).toUpperCase())) {
72 uniqueString = null;
73 getDescriptionUnique();
74 }
75
76 waitForElementPresentByName("document.documentHeader.documentDescription");
77
78 jiraAwareClearAndTypeByName("document.documentHeader.documentDescription", getDescriptionUnique());
79 jiraAwareClearAndTypeByName("document.newMaintainableObject.name", "name" + uniqueString);
80 jiraAwareClearAndTypeByName("document.newMaintainableObject.code", uniqueString.substring(5, 7));
81 }
82
83 @Override
84 protected void createNewLookupDetails() throws InterruptedException {
85 inputDetails();
86
87 String countryLookUp = "//input[@name='methodToCall.performLookup.(!!org.kuali.rice.location.impl.country.CountryBo!!).(((code:document.newMaintainableObject.countryCode,))).((`document.newMaintainableObject.countryCode:code,`)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;"
88 + getBaseUrlString() + "/kr/lookup.do;::::).anchor4']";
89 waitAndClickByXpath(countryLookUp);
90 waitAndClickSearch();
91 waitAndClickReturnValue();
92 }
93
94 @Test
95 public void testEditCancelBookmark() throws Exception {
96 testEditCancel();
97 passed();
98 }
99
100 @Test
101 public void testEditCancelNav() throws Exception {
102 testEditCancel();
103 passed();
104 }
105 }