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 waitAndTypeByName("document.documentHeader.documentDescription", getDescriptionUnique());
77 jiraAwareTypeByName("document.newMaintainableObject.name", "name" + uniqueString);
78 jiraAwareTypeByName("document.newMaintainableObject.code", uniqueString.substring(5, 7));
79 }
80
81 @Override
82 protected void createNewLookupDetails() throws InterruptedException {
83 inputDetails();
84
85 String countryLookUp = "//input[@name='methodToCall.performLookup.(!!org.kuali.rice.location.impl.country.CountryBo!!).(((code:document.newMaintainableObject.countryCode,))).((`document.newMaintainableObject.countryCode:code,`)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;"
86 + getBaseUrlString() + "/kr/lookup.do;::::).anchor4']";
87 waitAndClickByXpath(countryLookUp);
88 waitAndClickSearch();
89 waitAndClickReturnValue();
90 }
91
92 @Test
93 public void testEditCancelBookmark() throws Exception {
94 testEditCancel();
95 passed();
96 }
97
98 @Test
99 public void testEditCancelNav() throws Exception {
100 testEditCancel();
101 passed();
102 }
103 }