1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.demo.lookup.multivalue;
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
26
27 public class DemoLookUpMultiValueAft extends WebDriverLegacyITBase {
28
29
30
31
32 public static final String BOOKMARK_URL = "/kr-krad/lookup?methodToCall=start&viewId=LookupSampleViewMultipleValuesSelectLimit&hideReturnLink=true";
33
34
35
36
37 private static final String LOOKUP_CRITERIA_NUMBER_NAME="lookupCriteria[number]";
38
39
40
41
42 private static final String SEARCH="Search";
43
44
45
46
47 private static final String CLEAR_VALUES="Clear Values";
48
49
50
51
52 private static final String TABLE_ROW_SIX_XPATH="//table[@class='table table-condensed table-bordered uif-tableCollectionLayout dataTable']/tbody/tr[6]";
53
54
55
56
57 private static final String FAILURE_MESSAGE="Results are not restricted to 5 rows.";
58
59 @Override
60 public String getBookmarkUrl() {
61 return BOOKMARK_URL;
62 }
63
64 @Override
65 protected void navigate() throws Exception {
66 waitAndClickById("Demo-DemoLink", "");
67 waitAndClickByLinkText("Lookup Multi Value");
68 }
69
70 protected void testLookUpMultiValue() throws InterruptedException {
71 waitAndTypeByName(LOOKUP_CRITERIA_NUMBER_NAME, "a1");
72 waitAndClickButtonByText(SEARCH);
73 waitForElementPresentByXpath("//a[contains(text(), 'a1')]");
74 waitAndClickButtonByText(CLEAR_VALUES);
75 waitAndClickButtonByText(SEARCH);
76 waitForElementNotPresent(By.xpath(TABLE_ROW_SIX_XPATH));
77 }
78
79
80 @Test
81 public void testLookUpMultiValueBookmark() throws Exception {
82 testLookUpMultiValue();
83 passed();
84 }
85 }