1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.demo.lookup.view;
17
18 import org.kuali.rice.krad.demo.ViewDemoAftBase;
19 import org.junit.Test;
20
21
22
23
24 public class DemoLookUpActionsGroupedInHierarchyAft extends ViewDemoAftBase {
25
26
27
28
29 public static final String BOOKMARK_URL = "/kr-krad/lookup?methodToCall=start&viewId=LookupSampleViewActionsHierarchy";
30
31
32
33
34 private static final String TRAVEL_ACCOUNT_NUMBER="lookupCriteria[number]";
35
36
37
38
39 private static final String TRAVEL_ACCOUNT_NAME="lookupCriteria[name]";
40
41
42
43
44 private static final String SEARCH_BUTTON_TEXT="Search";
45
46
47
48
49 private static final String CLEAR_VALUES_BUTTON_TEXT="Clear Values";
50
51
52
53
54 private static final String PRINCIPAL_NAME="lookupCriteria[fiscalOfficer.principalName]";
55
56 @Override
57 public String getBookmarkUrl() {
58 return BOOKMARK_URL;
59 }
60
61 @Override
62 protected void navigate() throws Exception {
63 waitAndClickDemoLink();
64 waitAndClickByLinkText("Lookup actions grouped into a hierarchy");
65 }
66
67 protected void testLookUpActionsGroupedInHierarchy() throws InterruptedException {
68
69 waitAndTypeByName(TRAVEL_ACCOUNT_NUMBER,"A139638996");
70 waitAndClickButtonByText(SEARCH_BUTTON_TEXT);
71 waitForElementPresentByXpath("//a[contains(text(),'A139638996')]");
72 assertActionsGroupedInHierarchy();
73 waitAndClickButtonByText(CLEAR_VALUES_BUTTON_TEXT);
74
75
76 waitAndTypeByName(TRAVEL_ACCOUNT_NAME,"A1396389962525av");
77 waitAndClickButtonByText(SEARCH_BUTTON_TEXT);
78 waitForProgressLoading();
79 waitForTextPresent("A1396389962525av");
80 assertActionsGroupedInHierarchy();
81 waitAndClickButtonByText(CLEAR_VALUES_BUTTON_TEXT);
82
83
84 waitAndTypeByName(PRINCIPAL_NAME,"fran");
85 waitAndClickButtonByText(SEARCH_BUTTON_TEXT);
86 waitForTextPresent("fran");
87 assertActionsGroupedInHierarchy();
88 waitAndClickButtonByText(CLEAR_VALUES_BUTTON_TEXT);
89 }
90
91 private void assertActionsGroupedInHierarchy() throws InterruptedException{
92 waitForElementPresentByXpath("//a[contains(text(),'edit')]");
93 waitForElementPresentByXpath("//a[contains(text(),'loan')]");
94 waitForElementPresentByXpath("//a[contains(text(),'renew')]");
95 waitForElementPresentByXpath("//a[contains(text(),'return')]");
96 waitForElementPresentByXpath("//a[contains(text(),'copy')]");
97 waitForElementPresentByXpath("//a[contains(text(),'merge')]");
98 waitForElementPresentByXpath("//a[contains(text(),'separate')]");
99 waitForElementPresentByXpath("//a[contains(text(),'transfer')]");
100 }
101
102 @Test
103 public void testLookUpActionsGroupedInHierarchyBookmark() throws Exception {
104 testLookUpActionsGroupedInHierarchy();
105 passed();
106 }
107
108 @Test
109 public void testLookUpActionsGroupedInHierarchyNav() throws Exception {
110 testLookUpActionsGroupedInHierarchy();
111 passed();
112 }
113 }