1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.labs.kitchensink;
17
18 import org.junit.Ignore;
19 import org.junit.Test;
20 import org.openqa.selenium.JavascriptExecutor;
21
22
23
24
25 public class LabsLookupsAft extends LabsKitchenSinkBase {
26
27
28
29
30 public static final String BOOKMARK_URL = "/kr-krad/uicomponents?viewId=UifCompView&pageId=UifCompView-Page6&lightbox=true";
31
32 @Override
33 protected String getBookmarkUrl() {
34 return BOOKMARK_URL;
35 }
36
37 @Override
38 protected void navigate() throws Exception {
39 navigateToKitchenSink("Lookups, etc");
40 }
41
42 @Test
43 @Ignore
44 public void testAjaxLookupBookmark() throws Exception {
45 testAjaxLookup();
46 passed();
47 }
48
49 @Test
50 @Ignore
51 public void testAjaxLookupNav() throws Exception {
52 testAjaxLookup();
53 passed();
54 }
55
56 @Test
57 public void testLookupsBookmark() throws Exception {
58 testLookups();
59 passed();
60 }
61
62 @Test
63 public void testLookupsNav() throws Exception {
64 testLookups();
65 passed();
66 }
67
68 protected void testAjaxLookup() throws InterruptedException {
69 clearTextByName("field79");
70 waitAndTypeByName("field79", "a3");
71 ((JavascriptExecutor)driver).executeScript("document.getElementsByName('field79')[0].blur();");
72 waitForTextPresent("Travel Account 3");
73 }
74
75 protected void testLookups() throws InterruptedException {
76
77
78
79
80
81
82 clearTextByName("field72");
83 waitAndTypeByName("field72", "a2");
84 fireEvent("field72", "blur");
85 waitAndClickByName("field76");
86 waitForTextPresent("Travel Account 2");
87
88 clearTextByName("field76");
89 waitAndTypeByName("field76", "a1");
90 fireEvent("field76", "blur");
91 waitForTextPresent("Travel Account 1");
92
93 waitAndClickByXpath("//button[@class='btn btn-default uif-action icon-search']");
94 gotoLightBoxIframe();
95 waitAndClickSearchByText();
96 waitAndClickReturnValue();
97 waitAndClickByXpath("//div[@data-parent='refreshLookups1']/div/div/button[@class='btn btn-default uif-action icon-search']");
98 gotoLightBoxIframe();
99 waitAndClickSearchByText();
100 waitAndClickReturnValue();
101
102 clearTextByName("field70");
103 waitAndTypeByName("field70", "a1");
104 waitAndClickByXpath("//button[@title='Direct Inquiry']");
105 gotoLightBox();
106 assertTextPresent(new String[] {"Travel Account Number:", "a1", "Travel Account Name:", "Travel Account 1", "Code And Description:", "IAT - Income"});
107 waitAndClickButtonByText("Close");
108 }
109 }