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 DemoBasicLookUpAft extends ViewDemoAftBase {
25
26
27
28
29 public static final String BOOKMARK_URL = "/kr-krad/lookup?methodToCall=start&viewId=LookupSampleView";
30
31
32
33
34 private static final String TRAVEL_ACCOUNT_NUMBER_NAME="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 PRINCIPAL_NAME="lookupCriteria[fiscalOfficer.principalName]";
45
46 @Override
47 public String getBookmarkUrl() {
48 return BOOKMARK_URL;
49 }
50
51 @Override
52 protected void navigate() throws Exception {
53 waitAndClickDemoLink();
54 jGrowl("Click Lookup Link (Basic Lookup)");
55 waitAndClickByXpath("//a[@href='lookup?methodToCall=start&viewId=LookupSampleView']");
56 }
57
58 protected void testBasicLookUp() throws InterruptedException {
59
60 waitAndTypeByName(TRAVEL_ACCOUNT_NUMBER_NAME,"BALFTYHTB");
61 waitAndClickSearchByText();
62 waitForProgressLoading();
63 waitForTextPresent("BALFTYHTB");
64 waitAndClickClearValues();
65
66
67 waitAndTypeByName(TRAVEL_ACCOUNT_NAME,"Travel Account 2");
68 waitAndClickSearchByText();
69 waitForProgressLoading();
70 waitForTextPresent("Travel Account 2");
71 waitAndClickClearValues();
72
73
74 waitAndTypeByName(PRINCIPAL_NAME,"fred");
75 waitAndClickSearchByText();
76 waitForProgressLoading();
77 waitForTextPresent("Travel Account 1");
78 waitAndClickClearValues();
79
80
81 waitAndTypeByName("lookupCriteria[rangeLowerBoundKeyPrefix_createDate]","06/01/2000");
82 waitAndTypeByName("lookupCriteria[createDate]","06/01/2050");
83 waitAndClickSearchByText();
84 waitForProgressLoading();
85 waitForTextPresent("Travel Account");
86 }
87
88 protected void testBasicLookUpSearchEditSave() throws InterruptedException {
89
90 waitAndTypeByName(TRAVEL_ACCOUNT_NUMBER_NAME,"a2");
91 waitAndClickSearchByText();
92 waitForProgressLoading();
93 waitForTextPresent("a2");
94 waitAndClickByLinkText("edit");
95
96
97 waitAndTypeByName("document.documentHeader.documentDescription","Edited Description");
98 getTextByXpath("//div[@data-label='Travel Account Name']");
99 waitAndTypeByName("document.newMaintainableObject.dataObject.name"," Edited");
100
101 submitSuccessfully();
102 }
103
104 @Test
105 public void testBasicLookUpBookmark() throws Exception {
106 testBasicLookUp();
107 passed();
108 }
109
110 @Test
111 public void testBasicLookUpNav() throws Exception {
112 testBasicLookUp();
113 passed();
114 }
115
116 @Test
117 public void testBasicLookUpSearchEditSaveBookmark() throws Exception {
118 testBasicLookUpSearchEditSave();
119 passed();
120 }
121
122 @Test
123 public void testBasicLookUpSearchEditSaveNav() throws Exception {
124 testBasicLookUpSearchEditSave();
125 passed();
126 }
127 }