001/**
002 * Copyright 2005-2016 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 org.kuali.rice.krad.demo.uif.library.widgets;
017
018import org.junit.Test;
019import org.kuali.rice.krad.demo.uif.library.LibraryBase;
020
021/**
022 * @author Kuali Rice Team (rice.collab@kuali.org)
023 */
024public class LibraryWidgetsTooltipAft extends LibraryBase {
025
026         /**
027     * /kr-krad/kradsampleapp?viewId=Demo-TooltipView&methodToCall=start
028     */
029    public static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=Demo-TooltipView&methodToCall=start";
030
031    @Override
032    protected String getBookmarkUrl() {
033        return BOOKMARK_URL;
034    }
035
036    @Override
037    protected void navigate() throws Exception {
038        navigateToLibraryDemo("Widgets", "Tooltip");
039    }
040
041    protected void testWidgetsTooltipHover() throws Exception {
042        waitAndClickLinkContainingText("Tooltip On Hover");
043        fireMouseOverEventByName("dataField1");
044        waitForToolTipPresent();
045    }
046
047    protected void testWidgetsTooltipFocus() throws Exception {
048        waitAndClickLinkContainingText("Tooltip On Focus");
049        waitAndTypeByXpath("//section[@id='Demo-Tooltip-Example2']/div/input[@name='dataField1']",""); // XPATH as dataField1 is used as a name twice
050        waitForToolTipPresent();
051    }
052    
053    protected void testWidgetsTooltipHtml() throws Exception {
054        waitAndClickLinkContainingText("Tooltip HTML");
055        fireMouseOverEventByXpath("//section[@id='Demo-Tooltip-Example3']/div/input[@name='dataField1']");
056        waitForToolTipPresent();
057    }
058
059    @Test
060    public void testWidgetsTooltipBookmark() throws Exception {
061        testWidgetsTooltipHover();
062        testWidgetsTooltipFocus();
063        testWidgetsTooltipHtml();
064        passed();
065    }
066
067    @Test
068    public void testWidgetsTooltipNav() throws Exception {
069        testWidgetsTooltipHover();
070        testWidgetsTooltipFocus();
071        testWidgetsTooltipHtml();
072        passed();
073    }
074}