View Javadoc

1   /**
2    * Copyright 2005-2013 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package edu.samplu.krad.demo.travelapplication.accountmultivalue.lookup;
17  
18  import edu.samplu.common.SmokeTestBase;
19  import org.junit.Test;
20  
21  /**
22   * @author Kuali Rice Team (rice.collab@kuali.org)
23   */
24  public class DemoTravelAccountMultivalueLookUpSmokeTest extends SmokeTestBase {
25  
26      /**
27       * /kr-krad/lookup?methodToCall=start&dataObjectClassName=org.kuali.rice.krad.demo.travel.account.TravelAccount&hideReturnLink=true&multipleValuesSelect=true&suppressActions=true&conversionFields=number:foo,name:foo
28       */
29      public static final String BOOKMARK_URL = "/kr-krad/lookup?methodToCall=start&dataObjectClassName=org.kuali.rice.krad.demo.travel.account.TravelAccount&hideReturnLink=true&multipleValuesSelect=true&suppressActions=true&conversionFields=number:foo,name:foo";
30     
31      /**
32       * Search
33       */
34      public static final String SEARCH = "Search";
35      
36      @Override
37      public String getBookmarkUrl() {
38          return BOOKMARK_URL;
39      }
40  
41      protected void navigate() throws Exception {
42          waitAndClickById("Demo-DemoLink", "");
43          waitAndClickByLinkText("Account Multi-Value Lookup");
44      }
45  
46      protected void testTravelAccountMultivalueLookUp() throws Exception {
47         waitAndTypeByName("lookupCriteria[number]","a*");
48         selectByName("lookupCriteria[extension.accountTypeCode]", "Clearing Account Type");
49         waitAndClickButtonByText(SEARCH);
50         Thread.sleep(5000);
51         assertTextPresent("a14");
52         assertTextPresent("a6");
53         assertTextPresent("a9");
54         selectByName("lookupCriteria[extension.accountTypeCode]", "Expense Account Type");
55         waitAndClickButtonByText(SEARCH);
56         Thread.sleep(5000);
57         assertTextPresent("a2");
58         assertTextPresent("a8");
59         selectByName("lookupCriteria[extension.accountTypeCode]", "Income Account Type");
60         waitAndClickButtonByText(SEARCH);
61         Thread.sleep(5000);
62         assertTextPresent("a1");
63         assertTextPresent("a3");
64      }
65  
66      @Test
67      public void testTravelAccountMultivalueLookUpBookmark() throws Exception {
68          testTravelAccountMultivalueLookUp();
69          passed();
70      }
71  
72      @Test
73      public void testTravelAccountMultivalueLookUpNav() throws Exception {
74          testTravelAccountMultivalueLookUp();
75          passed();
76      }
77  }