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.demo.travel.account.maintenance;
017    
018    import org.openqa.selenium.By;
019    import org.openqa.selenium.internal.selenesedriver.SwitchToFrame;
020    
021    import edu.samplu.common.Failable;
022    import edu.samplu.common.ITUtil;
023    import edu.samplu.common.WebDriverLegacyITBase;
024    
025    /**
026     * @author Kuali Rice Team (rice.collab@kuali.org)
027     */
028    public abstract class DemoTravelAccountMaintenanceNewAbstractSmokeTestBase extends WebDriverLegacyITBase {
029    
030        /**
031         * //div[@class='fancybox-item fancybox-close']
032         */
033        public static final String FANCY_BOX_CLOSE_XPATH = "//div[@class='fancybox-item fancybox-close']";
034        
035        /**
036         * //div[@class='fancybox-item fancybox-close']
037         */
038        public static final String FANCY_BOX_IFRAME_XPATH = "//iframe[@class='fancybox-iframe']";
039    
040        /**
041         * /kr-krad/maintenance?methodToCall=start&dataObjectClassName=org.kuali.rice.krad.demo.travel.account.TravelAccount&hideReturnLink=true
042         */
043        public static final String BOOKMARK_URL = "/kr-krad/maintenance?methodToCall=start&dataObjectClassName=org.kuali.rice.krad.demo.travel.account.TravelAccount&hideReturnLink=true";
044    
045        @Override
046        public String getTestUrl() {
047            return ITUtil.KRAD_PORTAL;
048        }
049    
050        protected void navigation() throws Exception {
051            waitAndClickById("Demo-DemoLink", "");
052            waitAndClickByLinkText("Account Maintenance (New)");
053        }
054    
055        protected void testTravelAccountMaintenanceNew() throws Exception {
056            waitAndTypeByName("document.documentHeader.documentDescription","Travel Account Maintenance New Test Document");
057            waitAndTypeByName("document.newMaintainableObject.dataObject.number","a1");
058            waitAndClickByXpath("//input[@alt='Direct Inquiry']");
059            waitForElementPresentByXpath("//a[@title='Travel Account ']");
060            waitAndClickByXpath(FANCY_BOX_CLOSE_XPATH);
061            assertTextPresent("Travel Account Maintenance");
062        }
063    
064        public void testDemoTravelAccountMaintenanceNewBookmark(Failable failable) throws Exception {
065            testTravelAccountMaintenanceNew();
066            passed();
067        }
068    
069        public void testDemoTravelAccountMaintenanceNewNav(Failable failable) throws Exception {
070            navigation();
071            testTravelAccountMaintenanceNew();
072            passed();
073        }
074    }