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 */
016package edu.samplu.krad.compview;
017
018import edu.samplu.common.Failable;
019import edu.samplu.common.ITUtil;
020import edu.samplu.common.WebDriverLegacyITBase;
021
022/**
023 * Tests the Component section in Rice.
024 *
025 * @author Kuali Rice Team (rice.collab@kuali.org)
026 */
027public abstract class UifTooltipAbstractSmokeTestBase extends WebDriverLegacyITBase {
028
029    /**
030     * /kr-krad/uicomponents?viewId=UifCompView&methodToCall=start&pageId=UifCompView-Page10
031     */
032    public static final String BOOKMARK_URL = "/kr-krad/uicomponents?viewId=UifCompView&methodToCall=start&pageId=UifCompView-Page10";
033    
034    private static final String NAME_FIELD_1 = "field1";
035    private static final String NAME_FIELD_2 = "field2";
036    
037    /**
038     * Nav tests start at {@link edu.samplu.common.ITUtil#PORTAL}.  Bookmark Tests should override and return {@link UifTooltipAbstractSmokeTestBase#BOOKMARK_URL}
039     * {@inheritDoc}
040     * @return
041     */    
042    @Override
043    public String getTestUrl() {
044        return ITUtil.PORTAL;
045    }
046
047    protected void navigation() throws Exception {
048        waitAndClickKRAD();
049        waitAndClickByXpath(KITCHEN_SINK_XPATH);
050        switchToWindow(KUALI_UIF_COMPONENTS_WINDOW_XPATH);
051    }
052
053    protected void testUifTooltipNav(Failable failable) throws Exception {
054        navigation();
055        waitAndClickByLinkText("Other Examples");
056        testUifTooltip(NAME_FIELD_1, NAME_FIELD_2);
057        passed();
058    }
059
060    protected void testUifTooltipBookmark(Failable failable) throws Exception {
061        testUifTooltip(NAME_FIELD_1, NAME_FIELD_2);
062        passed();
063    }
064}