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.lookup;
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 DemoTravelAccountLookUpAbstractSmokeTestBase extends WebDriverLegacyITBase {
026    
027        /**
028         * /kr-krad/lookup?methodToCall=start&dataObjectClassName=org.kuali.rice.krad.demo.travel.account.TravelAccount&hideReturnLink=true&showMaintenanceLinks=true
029         */
030        public static final String BOOKMARK_URL = "/kr-krad/lookup?methodToCall=start&dataObjectClassName=org.kuali.rice.krad.demo.travel.account.TravelAccount&hideReturnLink=true&showMaintenanceLinks=true";
031        
032        /**
033         * Search
034         */
035        public static final String SEARCH = "Search";
036        
037        /**
038         * Clear Values
039         */
040        public static final String CLEAR_VALUES = "Clear Values";
041        
042        @Override
043        public String getTestUrl() {
044            return ITUtil.KRAD_PORTAL;
045        }
046    
047        protected void navigation() throws Exception {
048            waitAndClickById("Demo-DemoLink", "");
049            waitAndClickByLinkText("Account Lookup");
050        }
051    
052        protected void testTravelAccountLookUp() throws Exception {
053            waitAndTypeByName("lookupCriteria[number]","a1");
054            waitAndClickButtonByText(SEARCH);
055            Thread.sleep(3000);
056            assertElementPresentByXpath("//a[contains(text(), 'a1')]");
057            waitAndClickButtonByText(CLEAR_VALUES);
058            Thread.sleep(3000);
059            waitAndClickButtonByText(SEARCH);
060            Thread.sleep(3000);
061            assertElementPresentByXpath("//a[contains(text(), 'a1')]");
062            assertElementPresentByXpath("//a[contains(text(), 'a2')]");
063        }
064    
065        public void testTravelAccountLookUpBookmark(Failable failable) throws Exception {
066            testTravelAccountLookUp();
067            passed();
068        }
069    
070        public void testTravelAccountLookUpNav(Failable failable) throws Exception {
071            navigation();
072            testTravelAccountLookUp();
073            passed();
074        }
075    }