001 /*
002 * Copyright 2006-2012 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
017 package edu.samplu.admin.test;
018
019 import edu.samplu.common.UpgradedSeleniumITBase;
020 import org.junit.Test;
021
022 import static org.junit.Assert.fail;
023
024 /**
025 * test that repeated ajax refreshes work
026 * @author Kuali Rice Team (rice.collab@kuali.org)
027 */
028 public class AgendaEditRuleRefreshIT extends UpgradedSeleniumITBase {
029 @Override
030 public String getTestUrl() {
031 return PORTAL;
032 }
033
034 @Test
035 /**
036 * test that repeated ajax refreshes work
037 */
038 public void testAgendaEditRuleRefreshIT() throws Exception {
039 selenium.click("link=Agenda Lookup");
040 selenium.waitForPageToLoad("30000");
041 selenium.selectFrame("iframeportlet");
042 selenium.click("css=button:contains(earch)"); // selenium.click("id=32");
043 Thread.sleep(3000);
044 selenium.waitForPageToLoad("30000");
045 selenium.click("css=a[title='edit Agenda Definition withAgenda Id=T1000 ']"); // selenium.click("id=194_line0");
046 selenium.waitForPageToLoad("30000");
047 selenium.click("css=span:contains(Rule1: stub rule lorem ipsum [KrmsActionResolverType: testAction])"); // selenium.click("//li[@id='473_node_0_parent_root']/a");
048 selenium.click("id=472_node_0_parent_node_0_parent_node_0_parent_root_span");
049 selenium.click("id=361");
050
051 // click refresh several times
052 for (int i=0; i<6; i++) {
053 for (int second = 0;; second++) {
054 if (second >= 60) fail("timeout");
055 try { if (selenium.isElementPresent("id=440")) break; } catch (Exception e) {}
056 Thread.sleep(1000);
057 }
058
059 selenium.click("id=440");
060 }
061 }
062 }