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.krad.configview;
017    
018    import org.kuali.rice.testtools.selenium.Failable;
019    import org.kuali.rice.testtools.selenium.ITUtil;
020    import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
021    import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
022    
023    /**
024     * @author Kuali Rice Team (rice.collab@kuali.org)
025     */
026    public abstract class Help2AbstractSmokeTestBase extends WebDriverLegacyITBase {
027    
028        /**
029         * /kr-krad/configuration-test-view-uif-controller?viewId=ConfigurationTestView-Help&methodToCall=start
030         */
031        public static final String BOOKMARK_URL = "/kr-krad/configuration-test-view-uif-controller?viewId=ConfigurationTestView-Help&methodToCall=start";
032       
033        /**
034         * Nav tests start at {@link org.kuali.rice.testtools.selenium.ITUtil#PORTAL}.  Bookmark Tests should override and return {@link Help2AbstractSmokeTestBase#BOOKMARK_URL}
035         * {@inheritDoc}
036         * @return
037         */
038        @Override
039        public String getTestUrl() {
040            return ITUtil.PORTAL;
041        }
042    
043        protected void navigation() throws Exception {
044            waitAndClickKRAD();
045            waitAndClickByXpath(CONFIGURATION_VIEW_XPATH);
046            switchToWindow(CONFIGURATION_VIEW_WINDOW_TITLE);
047            waitAndClickByLinkText("Help");
048            Thread.sleep(5000);
049            selectFrameIframePortlet();
050        }
051    
052        protected void testHelp2Nav(Failable failable) throws Exception {
053            navigation();
054            testViewHelp2();
055            navigation();
056            testExternalHelp2();
057            navigation();
058            testDisplayOnlyExternalHelp2();
059            navigation();
060            testMissingExternalHelp2();
061            passed();
062        }
063    
064        protected void testHelp2Bookmark(Failable failable) throws Exception {
065            testViewHelp();
066            testPageHelp();
067            testTooltipHelp();
068            testDisplayOnlyTooltipHelp();
069            testMissingTooltipHelp();
070            passed();
071        }
072    }