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