1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.demo.uif.library.collections;
17
18 import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
19 import org.junit.Test;
20 import org.openqa.selenium.By;
21
22
23
24
25 public class DemoCollectionFeaturesMultiValueLookupAft extends WebDriverLegacyITBase {
26
27
28
29
30 public static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=Demo-CollectionLookupView&methodToCall=start";
31
32 @Override
33 protected String getBookmarkUrl() {
34 return BOOKMARK_URL;
35 }
36
37 @Override
38 protected void navigate() throws Exception {
39 jGrowl("Click the Library Link");
40 waitAndClickById("Demo-LibraryLink", "");
41 waitAndClickByLinkText("Collection Features");
42 waitAndClickByLinkText("Multi-Value Lookup");
43 }
44
45 protected void testMultiValueLookup() throws InterruptedException {
46 lightBoxLookupAddMultipleLines();
47
48 waitAndTypeByName("lookupCriteria[number]", "a1");
49 waitAndClickButtonByText("Search");
50 acceptAlertIfPresent();
51 assertButtonDisabledByText("return selected");
52
53 jGrowl("Check Travel Account 1 checkbox");
54 waitAndClickByValue("IAT:Travel Account 1:a1");
55 assertButtonEnabledByText("return selected");
56
57 jGrowl("Uncheck Travel Account 1 checkbox");
58 waitAndClickByValue("IAT:Travel Account 1:a1");
59 assertButtonDisabledByText("return selected");
60
61 waitAndClickButtonByText("return selected");
62 Thread.sleep(3000);
63 assertTextPresent("a1");
64 }
65
66 private void lightBoxLookupAddMultipleLines() throws InterruptedException {
67 waitAndClickByLinkText("Lookup/Add Multiple Lines");
68
69 driver.switchTo().frame(driver.findElement(By.cssSelector(".fancybox-iframe")));
70 selectTopFrame();
71 gotoIframeByXpath("//iframe[@class='fancybox-iframe']");
72 }
73
74 @Test
75 public void testMultiValueLookupBookmark() throws InterruptedException {
76 testMultiValueLookup();
77 passed();
78 }
79
80 @Test
81 public void testMultiValueLookupNav() throws InterruptedException {
82 testMultiValueLookup();
83 passed();
84 }
85
86 @Test
87 public void testMultivalueLookUpSelectThisPageBookmark() throws Exception {
88 lightBoxLookupAddMultipleLines();
89 testMultiValueSelectAllThisPage();
90 passed();
91 }
92
93 @Test
94 public void testMultivalueLookUpSelectThisPageNav() throws Exception {
95 lightBoxLookupAddMultipleLines();
96 testMultiValueSelectAllThisPage();
97 passed();
98 }
99
100 @Test
101 public void testMultivalueLookUpSelectAllPagesBookmark() throws Exception {
102 lightBoxLookupAddMultipleLines();
103 testMultiValueSelectAllPages();
104 passed();
105 }
106
107 @Test
108 public void testMultivalueLookUpSelectAllPagesNav() throws Exception {
109 lightBoxLookupAddMultipleLines();
110 testMultiValueSelectAllPages();
111 passed();
112 }
113 }