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 AffiliationTypeAft extends WebDriverLegacyITBase {
29
30
31
32
33
34
35
36 public static final String BOOKMARK_URL = AutomatedFunctionalTestUtils.PORTAL + "?channelTitle=Affiliation%20Type&channelUrl="
37 + WebDriverUtils.getBaseUrlString() + AutomatedFunctionalTestUtils.KRAD_LOOKUP_METHOD +
38 "org.kuali.rice.kim.impl.identity.affiliation.EntityAffiliationTypeBo&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("Affiliation Type");
50 }
51
52
53 protected void testAffiliationType() throws Exception {
54 selectFrameIframePortlet();
55
56
57 clickSearch();
58 String[][] data = {{"AFLT", "Affiliate", "d"},
59 {"FCLTY", "Faculty", "b"},
60 {"STAFF", "Staff", "c"}};
61 assertTextPresent(data);
62 waitAndClickClearValues();
63
64
65 waitAndClickByXpath("//input[@name='lookupCriteria[active]' and @value='Y']");
66 clickSearch();
67 assertTextPresent(data);
68 waitAndClickClearValues();
69
70
71 waitAndClickByXpath("//input[@name='lookupCriteria[active]' and @value='N']");
72 clickSearch();
73 waitForTextPresent("No values match this search.");
74 waitAndClickClearValues();
75
76
77 waitAndTypeByName("lookupCriteria[code]","AFLT");
78 clickSearch();
79 String[] assertSearchResultForTypeCode = {"AFLT", "Affiliate", "d"};
80 assertTextPresent(assertSearchResultForTypeCode);
81 waitAndClickClearValues();
82
83
84 waitAndTypeByName("lookupCriteria[name]","Affiliate");
85 clickSearch();
86 String[] assertSearchResultForTypeName = {"AFLT", "Affiliate", "d"};
87 assertTextPresent(assertSearchResultForTypeName);
88 waitAndClickClearValues();
89 }
90
91 protected void clickSearch() throws InterruptedException {
92 waitAndClickSearchByText();
93 }
94
95 @Test
96 public void testAffiliationTypeBookmark() throws Exception {
97 testAffiliationType();
98 passed();
99 }
100
101 @Test
102 public void testAffiliationTypeNav() throws Exception {
103 testAffiliationType();
104 passed();
105 }
106 }