001/**
002 * Copyright 2005-2015 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 edu.sampleu.main;
017
018import org.apache.commons.lang.RandomStringUtils;
019import org.kuali.rice.testtools.common.JiraAwareFailable;
020import org.kuali.rice.testtools.selenium.AutomatedFunctionalTestUtils;
021import org.kuali.rice.testtools.selenium.WebDriverUtils;
022
023/**
024 * @author Kuali Rice Team (rice.collab@kuali.org)
025 */
026public class ContextLookUpAftBase extends MainTmplMthdSTNavBase{
027
028    /**
029     * ITUtil.PORTAL + "?channelTitle=Context%20Lookup&channelUrl="
030     *   + WebDriverUtils.getBaseUrlString() + ITUtil.KRAD_LOOKUP_METHOD
031     *   + "org.kuali.rice.krms.impl.repository.ContextBo"
032     *   + ITUtil.SHOW_MAINTENANCE_LINKS
033     *   + "&returnLocation=" + ITUtil.PORTAL_URL + ITUtil.HIDE_RETURN_LINK;
034     */
035    public static final String BOOKMARK_URL = AutomatedFunctionalTestUtils.PORTAL + "?channelTitle=Context%20Lookup&channelUrl="
036            + WebDriverUtils.getBaseUrlString() + AutomatedFunctionalTestUtils.KRAD_LOOKUP_METHOD
037            + "org.kuali.rice.krms.impl.repository.ContextBo"
038            + AutomatedFunctionalTestUtils.SHOW_MAINTENANCE_LINKS
039            + "&returnLocation=" + AutomatedFunctionalTestUtils.PORTAL_URL + AutomatedFunctionalTestUtils.HIDE_RETURN_LINK;
040
041    @Override
042    protected String getBookmarkUrl() {
043        return BOOKMARK_URL;
044    }
045
046    /**
047     * {@inheritDoc}
048     * Context Lookup
049     * @return
050     */
051    @Override
052    protected String getLinkLocator() {
053        return "Context Lookup";
054    }
055
056    public void testContextLookUpBookmark(JiraAwareFailable failable) throws Exception {
057        contextLookupAssertions();
058        passed();
059    }
060    public void testContextLookUpNav(JiraAwareFailable failable) throws Exception {
061        contextLookupAssertions();
062        passed();
063    }
064
065    public void testContextCopy(JiraAwareFailable failable) throws Exception {
066        waitAndClickSearchByText();
067        waitAndClickLinkContainingText("copy");
068        String randomNumber = RandomStringUtils.randomAlphabetic(4);
069        waitAndTypeByName("document.newMaintainableObject.dataObject.id", "Context " + randomNumber);
070        clearTextByName("document.newMaintainableObject.dataObject.name");
071        waitAndTypeByName("document.newMaintainableObject.dataObject.name", "Context name" + randomNumber);
072        clearTextByName("document.newMaintainableObject.dataObject.description");
073        waitAndTypeByName("document.newMaintainableObject.dataObject.description", "Context desc" + randomNumber);
074        waitAndClickButtonByText("Submit");
075        waitAndClickConfirmSubmitOk();
076        waitForProgressLoading(WebDriverUtils.configuredImplicityWait() * 10);
077        waitForTextPresent("Document was successfully submitted.");
078        passed();
079    }
080}