1 /*
2 * Copyright 2006-2012 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
17 package edu.samplu.krad.compview;
18
19 import edu.samplu.common.UpgradedSeleniumITBase;
20 import org.junit.Test;
21
22 import static org.junit.Assert.assertEquals;
23 import static org.junit.Assert.fail;
24
25 /**
26 * tests that the parent line variable is available in a sub collection
27 *
28 * <p>configuration done in /edu/sampleu/demo/kitchensink/UifComponentsViewP7.xml on bean id="subCollection1"</p>
29 *
30 * @author Kuali Rice Team (rice.collab@kuali.org)
31 */
32 public class ParentLineIT extends UpgradedSeleniumITBase {
33 @Override
34 public String getTestUrl() {
35 return PORTAL;
36 }
37
38 @Test
39 /**
40 * tests that the size of a sub collection is correctly displayed using the parentLine el variable
41 */
42 public void testSubCollectionSize() throws Exception {
43 selenium.click("link=KRAD");
44 selenium.waitForPageToLoad("30000");
45 selenium.click("link=Uif Components (Kitchen Sink)");
46 selenium.waitForPageToLoad("30000");
47 // selenium.selectFrame("iframeportlet");
48 // click on collections page link
49 selenium.click("id=u961");
50 // Thread.sleep(30000);
51 // wait for collections page to load by checking the presence of a sub collection line item
52 for (int second = 0;; second++) {
53 if (second >= 60) fail("timeout");
54 try { if (selenium.isElementPresent("id=u1089_line0_line0_control")) break; } catch (Exception e) {}
55 Thread.sleep(1000);
56 }
57 // verify that sub collection sizes are displayed as expected
58 assertEquals("SubCollection - (3 lines)", selenium.getText("id=u1030_line0"));
59 assertEquals("SubCollection - (2 lines)", selenium.getText("id=u1030_line1"));
60 }
61 }