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