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 DemoLookUpVerticallyStackedActionsAft extends ViewDemoAftBase {
25
26
27
28
29 public static final String BOOKMARK_URL = "/kr-krad/lookup?methodToCall=start&viewId=LookupSampleViewVerticalActions";
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 vertically stacked actions");
65 }
66
67 protected void testLookUpVerticallyStackedActions() throws InterruptedException {
68
69 waitAndTypeByName(TRAVEL_ACCOUNT_NUMBER,"a1");
70 waitAndClickButtonByText(SEARCH_BUTTON_TEXT);
71 waitForProgressLoading();
72 assertVerticallyStackedActions();
73 waitAndClickButtonByText(CLEAR_VALUES_BUTTON_TEXT);
74
75
76 waitAndTypeByName(PRINCIPAL_NAME,"fran");
77 waitAndClickButtonByText(SEARCH_BUTTON_TEXT);
78 waitForProgressLoading();
79 assertVerticallyStackedActions();
80 waitAndClickButtonByText(CLEAR_VALUES_BUTTON_TEXT);
81
82
83 waitAndTypeByName(TRAVEL_ACCOUNT_NAME,"Travel Account 3");
84 waitAndClickButtonByText(SEARCH_BUTTON_TEXT);
85 waitForProgressLoading();
86 assertVerticallyStackedActions();
87 waitAndClickButtonByText(CLEAR_VALUES_BUTTON_TEXT);
88 }
89
90 private void assertVerticallyStackedActions() throws InterruptedException{
91 waitIsVisibleByXpath("//a[contains(text(),'edit') and @class='uif-link uif-boxLayoutVerticalItem pull-left clearfix']");
92 assertTrue(isVisibleByXpath("//a[contains(text(),'copy') and @class='uif-link uif-boxLayoutVerticalItem pull-left clearfix']"));
93 }
94
95 @Test
96 public void testLookUpVerticallyStackedActionsBookmark() throws Exception {
97 testLookUpVerticallyStackedActions();
98 passed();
99 }
100
101 @Test
102 public void testLookUpVerticallyStackedActionsNav() throws Exception {
103 testLookUpVerticallyStackedActions();
104 passed();
105 }
106 }