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