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 CollectionsAbstractSmokeTestBase extends WebDriverLegacyITBase {
026    
027        /**
028         * /kr-krad/uicomponents?viewId=ConfigurationTestView-Collections&methodToCall=start
029         */
030        public static final String BOOKMARK_URL = "/kr-krad/uicomponents?viewId=ConfigurationTestView-Collections&methodToCall=start";
031    
032        /**
033         * (//a[contains(text(),'Collections Configuration Test View')])[2]
034         */
035        public static final String TEXT_COLLECTIONS_CONFIGURATION_TEST_VIEW_XPATH =
036                "(//a[contains(text(),'Collections Configuration Test View')])[2]";
037    
038        /**
039         * Kuali :: Collection Test View
040         */
041        public static final String KUALI_COLLECTION_WINDOW_TITLE = "Kuali :: Collection Test View";
042        
043        /**
044         * Nav tests start at {@link edu.samplu.common.ITUtil#PORTAL}.  Bookmark Tests should override and return {@link CollectionsAbstractSmokeTestBase#BOOKMARK_URL}
045         * {@inheritDoc}
046         * @return
047         */
048        @Override
049        public String getTestUrl() {
050            return ITUtil.PORTAL;
051        }
052    
053        protected void navigation() throws Exception {
054            waitAndClickKRAD();
055            waitAndClickByXpath(TEXT_COLLECTIONS_CONFIGURATION_TEST_VIEW_XPATH);
056            switchToWindow(KUALI_COLLECTION_WINDOW_TITLE);
057        }
058    
059        protected void testCollectionsNav(Failable failable) throws Exception {
060            navigation();
061            testDefaultTestsTableLayout();
062            navigation();
063            testAddBlankLine();
064            navigation();
065            testActionColumnPlacement();
066            navigation();
067            testAddViaLightbox();
068            navigation();
069            testColumnSequence();
070            navigation();
071            testSequencerow();
072            passed();
073        }
074    
075        protected void testCollectionsBookmark(Failable failable) throws Exception {
076            testDefaultTestsTableLayout();
077            testAddBlankLine();
078            testActionColumnPlacement();
079            testAddViaLightbox();
080            testColumnSequence();
081            testSequencerow();
082            passed();
083        }
084    }