001 /** 002 * Copyright 2005-2013 The Kuali Foundation 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 package edu.samplu.krad.demo.travelapplication.accountmultivalue.lookup; 017 018 import edu.samplu.common.SmokeTestBase; 019 import org.junit.Test; 020 021 /** 022 * @author Kuali Rice Team (rice.collab@kuali.org) 023 */ 024 public class DemoTravelAccountMultivalueLookUpSmokeTest extends SmokeTestBase { 025 026 /** 027 * /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 028 */ 029 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"; 030 031 /** 032 * Search 033 */ 034 public static final String SEARCH = "Search"; 035 036 @Override 037 public String getBookmarkUrl() { 038 return BOOKMARK_URL; 039 } 040 041 protected void navigate() throws Exception { 042 waitAndClickById("Demo-DemoLink", ""); 043 waitAndClickByLinkText("Account Multi-Value Lookup"); 044 } 045 046 protected void testTravelAccountMultivalueLookUp() throws Exception { 047 waitAndTypeByName("lookupCriteria[number]","a*"); 048 selectByName("lookupCriteria[extension.accountTypeCode]", "Clearing Account Type"); 049 waitAndClickButtonByText(SEARCH); 050 Thread.sleep(5000); 051 assertTextPresent("a14"); 052 assertTextPresent("a6"); 053 assertTextPresent("a9"); 054 selectByName("lookupCriteria[extension.accountTypeCode]", "Expense Account Type"); 055 waitAndClickButtonByText(SEARCH); 056 Thread.sleep(5000); 057 assertTextPresent("a2"); 058 assertTextPresent("a8"); 059 selectByName("lookupCriteria[extension.accountTypeCode]", "Income Account Type"); 060 waitAndClickButtonByText(SEARCH); 061 Thread.sleep(5000); 062 assertTextPresent("a1"); 063 assertTextPresent("a3"); 064 } 065 066 @Test 067 public void testTravelAccountMultivalueLookUpBookmark() throws Exception { 068 testTravelAccountMultivalueLookUp(); 069 passed(); 070 } 071 072 @Test 073 public void testTravelAccountMultivalueLookUpNav() throws Exception { 074 testTravelAccountMultivalueLookUp(); 075 passed(); 076 } 077 }