1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.demo.travel.account;
17
18 import org.junit.Test;
19 import org.kuali.rice.krad.demo.ViewDemoAftBase;
20 import org.kuali.rice.krad.util.KRADConstants;
21 import org.kuali.rice.testtools.selenium.AutomatedFunctionalTestUtils;
22 import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
23
24 import static org.junit.Assert.assertEquals;
25
26
27
28
29 public class DemoTravelAccountMultivalueParameterRestrictionLookUpAft extends ViewDemoAftBase {
30
31
32
33
34 public static final String BOOKMARK_URL = "/kr-krad/lookup?methodToCall=start&dataObjectClassName=org.kuali.rice.krad.demo.travel.dataobject.TravelAccount&hideReturnLink=true&multipleValuesSelect=true&lookupCollectionName=travelAccounts&suppressActions=true&conversionFields=number:foo,name:foo";
35
36 @Override
37 public String getBookmarkUrl() {
38 return BOOKMARK_URL;
39 }
40
41 @Override
42 protected void navigate() throws Exception {
43 waitAndClickDemoLink();
44 waitAndClickByLinkText("Account Multi-Value Lookup");
45 }
46
47 private void testParameterRestrictionSearchSelect() throws Exception {
48 waitAndClickSearch3();
49 waitForElementPresent(DATA_TABLE_TR_CSS);
50 assertEquals("Wrong number of search results", 10, getCssCount(DATA_TABLE_TR_CSS));
51
52 setParameter(KRADConstants.KRAD_NAMESPACE, KRADConstants.DetailTypes.LOOKUP_PARM_DETAIL_TYPE,
53 KRADConstants.SystemGroupParameterNames.MULTIPLE_VALUE_LOOKUP_RESULTS_LIMIT, "1");
54
55 navigate();
56 waitAndClickSearch3();
57 waitForElementPresent(DATA_TABLE_TR_CSS);
58 assertEquals("Wrong number of search results", 1, getCssCount(DATA_TABLE_TR_CSS));
59
60 setParameter(KRADConstants.KRAD_NAMESPACE, KRADConstants.DetailTypes.LOOKUP_PARM_DETAIL_TYPE,
61 KRADConstants.SystemGroupParameterNames.MULTIPLE_VALUE_LOOKUP_RESULTS_LIMIT, "100");
62
63 navigate();
64 waitAndClickSearch3();
65 waitForElementPresent(DATA_TABLE_TR_CSS);
66 assertEquals("Wrong number of search results", 10, getCssCount(DATA_TABLE_TR_CSS));
67 }
68
69 private void setParameter(String namespaceCode, String componentCode, String parameterName, String parameterValue)
70 throws Exception {
71
72 driver.get(AutomatedFunctionalTestUtils.LABS_URL);
73 waitAndClickByLinkText("Parameter Updater");
74
75 waitAndTypeByName("namespaceCode", namespaceCode);
76 waitAndTypeByName("componentCode", componentCode);
77 waitAndTypeByName("parameterName", parameterName);
78 waitAndTypeByName("parameterValue", parameterValue);
79 waitAndClickButtonByText("Update Parameter");
80
81 waitForPageToLoad();
82 }
83
84 @Test
85 public void testTravelAccountMultivalueParameterRestrictionLookUpSearchSelectBookmark() throws Exception {
86 testParameterRestrictionSearchSelect();
87 passed();
88 }
89
90 @Test
91 public void testTravelAccountMultivalueParameterRestrictionLookUpSearchSelectNav() throws Exception {
92 testParameterRestrictionSearchSelect();
93 passed();
94 }
95 }