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.util.KRADConstants;
20 import org.kuali.rice.testtools.selenium.AutomatedFunctionalTestUtils;
21 import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
22
23 import static org.junit.Assert.assertEquals;
24
25
26
27
28 public class DemoTravelAccountMultivalueParameterRestrictionLookUpAft extends WebDriverLegacyITBase {
29
30
31
32
33 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";
34
35 @Override
36 public String getBookmarkUrl() {
37 return BOOKMARK_URL;
38 }
39
40 @Override
41 protected void navigate() throws Exception {
42 waitAndClickById("Demo-DemoLink", "");
43 waitAndClickByLinkText("Account Multi-Value Lookup");
44 }
45
46 private void testParameterRestrictionSearchSelect() throws Exception {
47 waitAndClickSearch3();
48 waitForElementPresent(DATA_TABLE_TR_CSS);
49 assertEquals("Wrong number of search results", 10, getCssCount(DATA_TABLE_TR_CSS));
50
51 setParameter(KRADConstants.KRAD_NAMESPACE, KRADConstants.DetailTypes.LOOKUP_PARM_DETAIL_TYPE,
52 KRADConstants.SystemGroupParameterNames.MULTIPLE_VALUE_LOOKUP_RESULTS_LIMIT, "1");
53
54 navigate();
55 waitAndClickSearch3();
56 waitForElementPresent(DATA_TABLE_TR_CSS);
57 assertEquals("Wrong number of search results", 1, getCssCount(DATA_TABLE_TR_CSS));
58
59 setParameter(KRADConstants.KRAD_NAMESPACE, KRADConstants.DetailTypes.LOOKUP_PARM_DETAIL_TYPE,
60 KRADConstants.SystemGroupParameterNames.MULTIPLE_VALUE_LOOKUP_RESULTS_LIMIT, "100");
61
62 navigate();
63 waitAndClickSearch3();
64 waitForElementPresent(DATA_TABLE_TR_CSS);
65 assertEquals("Wrong number of search results", 10, getCssCount(DATA_TABLE_TR_CSS));
66 }
67
68 private void setParameter(String namespaceCode, String componentCode, String parameterName, String parameterValue)
69 throws Exception {
70
71 driver.get(AutomatedFunctionalTestUtils.LABS_URL);
72 waitAndClickByLinkText("Parameter Updater");
73
74 waitAndTypeByName("namespaceCode", namespaceCode);
75 waitAndTypeByName("componentCode", componentCode);
76 waitAndTypeByName("parameterName", parameterName);
77 waitAndTypeByName("parameterValue", parameterValue);
78 waitAndClickButtonByText("Update Parameter");
79
80 waitForPageToLoad();
81 }
82
83 @Test
84 public void testTravelAccountMultivalueParameterRestrictionLookUpSearchSelectBookmark() throws Exception {
85 testParameterRestrictionSearchSelect();
86 passed();
87 }
88
89 @Test
90 public void testTravelAccountMultivalueParameterRestrictionLookUpSearchSelectNav() throws Exception {
91 testParameterRestrictionSearchSelect();
92 passed();
93 }
94 }