1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.sampleu.krad.reference;
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 EmailTypeAft extends WebDriverLegacyITBase {
29
30
31
32
33
34
35
36 public static final String BOOKMARK_URL = AutomatedFunctionalTestUtils.PORTAL + "?channelTitle=Email%20Type&channelUrl="
37 + WebDriverUtils.getBaseUrlString() + AutomatedFunctionalTestUtils.KRAD_LOOKUP_METHOD +
38 "org.kuali.rice.kim.impl.identity.email.EntityEmailTypeBo&returnLocation="
39 + AutomatedFunctionalTestUtils.PORTAL_URL + AutomatedFunctionalTestUtils.HIDE_RETURN_LINK;
40
41 @Override
42 protected String getBookmarkUrl() {
43 return BOOKMARK_URL;
44 }
45
46 @Override
47 protected void navigate() throws InterruptedException {
48 waitAndClickKRAD();
49 waitAndClickByLinkText("Email Type");
50 }
51
52 protected void clickSearch() throws InterruptedException {
53 waitAndClickSearchByText();
54 }
55
56
57 protected void testEmailType() throws Exception {
58 selectFrameIframePortlet();
59
60
61 clickSearch();
62 String[][] data = {{"HM", "Home", "b"},
63 {"OTH", "Other", "c"},
64 {"WRK", "Work", "a"}};
65 assertTextPresent(data);
66 waitAndClickClearValues();
67
68
69 waitAndClickByXpath("//input[@name='lookupCriteria[active]' and @value='Y']");
70 clickSearch();
71 assertTextPresent(data);
72 waitAndClickClearValues();
73
74
75 waitAndClickByXpath("//input[@name='lookupCriteria[active]' and @value='N']");
76 clickSearch();
77 waitForTextPresent("No values match this search.");
78 waitAndClickClearValues();
79
80
81 waitAndTypeByName("lookupCriteria[code]","HM");
82 clickSearch();
83 String[] assertSearchResultForTypeCode = {"HM", "Home", "b"};
84 assertTextPresent(assertSearchResultForTypeCode);
85 waitAndClickClearValues();
86
87
88 waitAndTypeByName("lookupCriteria[name]","Home");
89 clickSearch();
90 String[] assertSearchResultForTypeName = {"HM", "Home", "b"};
91 assertTextPresent(assertSearchResultForTypeName);
92 waitAndClickClearValues();
93 }
94
95 @Test
96 public void testEmailTypeBookmark() throws Exception {
97 testEmailType();
98 passed();
99 }
100
101 @Test
102 public void testEmailTypeNav() throws Exception {
103 testEmailType();
104 passed();
105 }
106 }