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