1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.samplu.krad.demo.lookupviews.lookup.multivalue;
17
18 import org.kuali.rice.testtools.selenium.SmokeTestBase;
19 import org.junit.Ignore;
20 import org.junit.Test;
21
22
23
24
25 public class DemoLookUpMultiValueSmokeTest extends SmokeTestBase {
26
27
28
29
30 public static final String BOOKMARK_URL = "/kr-krad/lookup?methodToCall=start&viewId=LookupSampleViewMultipleValuesSelectLimit&hideReturnLink=true";
31
32
33
34
35 private static final String LOOKUP_CRITERIA_NUMBER_NAME="lookupCriteria[number]";
36
37
38
39
40 private static final String SEARCH="Search";
41
42
43
44
45 private static final String CLEAR_VALUES="Clear Values";
46
47
48
49
50 private static final String TABLE_ROW_SIX_XPATH="//table[@class='table table-condensed table-bordered uif-tableCollectionLayout dataTable']/tbody/tr[6]";
51
52
53
54
55 private static final String FAILURE_MESSAGE="Results are not restricted to 5 rows.";
56
57 @Override
58 public String getBookmarkUrl() {
59 return BOOKMARK_URL;
60 }
61
62 @Override
63 protected void navigate() throws Exception {
64 waitAndClickById("Demo-DemoLink", "");
65 waitAndClickByLinkText("Lookup Multi Value");
66 }
67
68 protected void testLookUpMultiValue() throws InterruptedException {
69 waitAndTypeByName(LOOKUP_CRITERIA_NUMBER_NAME,"a1");
70 waitAndClickButtonByText(SEARCH);
71 Thread.sleep(3000);
72 waitForElementPresentByXpath("//a[contains(text(), 'a1')]");
73 waitAndClickButtonByText(CLEAR_VALUES);
74 waitAndClickButtonByText(SEARCH);
75 Thread.sleep(3000);
76 if(isElementPresentByXpath(TABLE_ROW_SIX_XPATH)){
77 fail(FAILURE_MESSAGE);
78 }
79 }
80
81 @Test
82 public void testLookUpMultiValueBookmark() throws Exception {
83 testLookUpMultiValue();
84 passed();
85 }
86
87 @Ignore
88 @Test
89 public void testLookUpMultiValueNav() throws Exception {
90 testLookUpMultiValue();
91 passed();
92 }
93 }