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.travel.krad.test;
017
018 import edu.samplu.common.Failable;
019 import edu.samplu.common.ITUtil;
020 import edu.samplu.common.WebDriverLegacyITBase;
021
022 /**
023 * Tests the Component section in Rice.
024 *
025 * @author Kuali Rice Team (rice.collab@kuali.org)
026 */
027 public abstract class ConfigurationTestViewAbstractSmokeTestBase extends WebDriverLegacyITBase {
028
029 /**
030 * "/kr-krad/configuration-test-view-uif-controller?viewId=ConfigurationTestView_KNS&methodToCall=start";
031 */
032 public static final String BOOKMARK_URL = "/kr-krad/configuration-test-view-uif-controller?viewId=ConfigurationTestView_KNS&methodToCall=start";
033
034 /** bean id prefix in used in view */
035 private String idPrefix = "ConfigurationTestView-ProgressiveRender-";
036
037 /** bean id suffix for add line controls */
038 String addLineIdSuffix = "InputField_add_control";
039
040
041 protected void bookmark() {
042 open(ITUtil.getBaseUrlString() + BOOKMARK_URL);
043 }
044
045 /**
046 * Nav tests start at {@link edu.samplu.common.ITUtil#PORTAL}.
047 * Bookmark Tests should override and return {@link edu.samplu.travel.krad.test.ConfigurationTestViewAbstractSmokeTestBase#BOOKMARK_URL}
048 * {@inheritDoc}
049 * @return
050 */
051 @Override
052 public String getTestUrl() {
053 return ITUtil.PORTAL;
054 }
055
056 protected void navigation() throws InterruptedException {
057 waitAndClickKRAD();
058 waitAndClickByXpath("(//a[text()='Configuration Test View'])[2]");
059 switchToWindow(CONFIGURATION_VIEW_WINDOW_TITLE);
060 waitForTitleToEqualKualiPortalIndex();
061 }
062
063 protected void testConfigurationTestViewNav(Failable failable) throws Exception {
064 navigation();
065 testConfigurationTestView(idPrefix);
066 navigation();
067 testAddLineWithSpecificTime(idPrefix, addLineIdSuffix);
068 navigation();
069 testAddLineWithAllDay(idPrefix, addLineIdSuffix);
070 navigation();
071 testAddLineAllDay(idPrefix, addLineIdSuffix);
072 passed();
073 }
074
075 protected void testConfigurationTestViewBookmark(Failable failable) throws Exception {
076 testConfigurationTestView(idPrefix);
077 testAddLineWithSpecificTime(idPrefix, addLineIdSuffix);
078 testAddLineWithAllDay(idPrefix, addLineIdSuffix);
079 testAddLineAllDay(idPrefix, addLineIdSuffix);
080 passed();
081 }
082 }