01: /*
02: * Copyright 2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
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 org.kuali.rice.lookup;
17:
18: import org.junit.Test;
19: import org.kuali.rice.TestBase;
20: import org.kuali.rice.testharness.HtmlUnitUtil;
21:
22: import com.gargoylesoftware.htmlunit.html.HtmlForm;
23: import com.gargoylesoftware.htmlunit.html.HtmlInput;
24: import com.gargoylesoftware.htmlunit.html.HtmlPage;
25: import com.gargoylesoftware.htmlunit.html.HtmlTable;
26: import com.gargoylesoftware.htmlunit.html.HtmlTableCell;
27: import com.gargoylesoftware.htmlunit.html.HtmlTableRow;
28:
29: public class BaseLookupTest extends TestBase {
30:
31: @Test
32: public void testLookupable() throws Exception {
33:
34: HtmlPage lookupPage = HtmlUnitUtil
35: .gotoPageAndLogin(HtmlUnitUtil.BASE_URL
36: + "/kr/lookup.do?methodToCall=start&businessObjectClassName=edu.sampleu.travel.bo.TravelAccount&returnLocation=portal.do&hideReturnLink=true&docFormKey=88888888");
37: assertEquals("Kuali :: Lookup", lookupPage.getTitleText());
38:
39: HtmlForm lookupForm = (HtmlForm) lookupPage
40: .getFormByName("KualiForm");
41: HtmlInput searchButton = (HtmlInput) lookupForm
42: .getInputByName("methodToCall.search");
43: HtmlPage searchResultsPage = (HtmlPage) searchButton.click();
44: HtmlTable resultsTable = (HtmlTable) searchResultsPage
45: .getHtmlElementById("row");
46: HtmlTableRow row1 = (HtmlTableRow) resultsTable.getRow(0);
47: HtmlTableCell cell1 = (HtmlTableCell) row1.getCell(0);
48:
49: assertNotNull(resultsTable);
50: }
51:
52: }
|