001    /**
002     * Copyright 2005-2011 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.common;
017    
018    import org.junit.Test;
019    import org.openqa.selenium.By;
020    
021    /**
022     * @deprecated use WebDriverITBase
023     * @author Kuali Rice Team (rice.collab@kuali.org)
024     */
025    public abstract class MainMenuLookupLegacyITBase extends MenuLegacyITBase {
026        @Override
027        protected String getCreateNewLinkLocator() {
028            return "Create New";
029        }
030    
031        @Override
032        protected String getMenuLinkLocator() {
033            return "Main Menu";
034        }
035    
036        /**
037         * Override to execute assertions once a looked-up item's edit action is clicked.
038         */
039        public abstract void lookupAssertions();
040    
041        @Test
042        public void testLookUp() throws Exception {
043            waitAndClickByLinkText(getLinkLocator());
044            waitForPageToLoad();
045            selectFrame("iframeportlet");
046            // Mixed capitalization
047            waitAndClick(By.xpath("//button[contains(text(),'Search')]"));
048            waitAndClickByLinkText("edit", "edit button not present does user " + user + " have permission?");
049            checkForIncidentReport("submit");
050            assertTextPresent("ubmit");
051            assertTextPresent("ave");
052            assertTextPresent("pprove");
053            assertTextPresent("lose");
054            assertTextPresent("ancel");
055            lookupAssertions();
056            waitAndClick(By.xpath("//a[contains(text(), 'Cancel')]"));
057            passed();
058        }
059    }