001/**
002 * Copyright 2005-2014 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 */
016package org.kuali.rice.krad.labs;
017
018import org.junit.Test;
019import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
020import org.openqa.selenium.By;
021
022/**
023 * @author Kuali Rice Team (rice.collab@kuali.org)
024 */
025public class LabsTravelCompanyLookUpDisableNewAndCopyAft extends WebDriverLegacyITBase {
026
027    /**
028     * /kr-krad/uicomponents?viewId=Lab-NativeAutocomplete-DisableField
029     */
030    public static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=KradMaintenanceSample-PageR1C2";
031
032    @Override
033    protected String getBookmarkUrl() {
034        return BOOKMARK_URL;
035    }
036
037    @Override
038    protected void navigate() throws Exception {
039        waitAndClickByLinkText("Maintenance");
040        waitAndClickByLinkText("Maintenance Sample - Disable New and Copy");
041    }
042
043    protected void testTravelCompanyLookUpDisableNewAndCopy() throws InterruptedException {
044        waitAndClickByLinkText("Travel Company Maintenance Sample - Disable New and Copy");
045        waitAndTypeByName("lookupCriteria[travelCompanyId]","10000");
046        waitAndClickSearchByText();
047        waitForElementPresentByXpath("//a[contains(text(),'10000')]");
048        waitAndClickButtonByText("Clear Values");
049        waitAndTypeByName("lookupCriteria[travelCompanyName]","AAA Travel");
050        waitAndClickByXpath("//input[@name='lookupCriteria[active]' and @value='N']");
051        waitAndClickSearchByText();
052        waitForElementPresentByXpath("//a[contains(text(),'10001')]");
053        waitForTextPresent("AAA Travel");
054        waitForElementNotPresent(By.xpath("//a[contains(text(),'copy')]"));
055        waitForElementNotPresent(By.xpath("//a[contains(text(),'create new')]"));
056    }
057
058    @Test
059    public void testTravelCompanyLookUpDisableNewAndCopyBookmark() throws Exception {
060        testTravelCompanyLookUpDisableNewAndCopy();
061        passed();
062    }
063
064    @Test
065    public void testTravelCompanyLookUpDisableNewAndCopyNav() throws Exception {
066        testTravelCompanyLookUpDisableNewAndCopy();
067        passed();
068    }
069}