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 edu.sampleu.admin;
017
018import org.kuali.rice.testtools.common.JiraAwareFailable;
019import org.kuali.rice.testtools.selenium.AutomatedFunctionalTestUtils;
020import org.kuali.rice.testtools.selenium.WebDriverUtils;
021
022import java.util.List;
023
024/**
025 * @author Kuali Rice Team (rice.collab@kuali.org)
026 */
027public abstract class ParameterTypeAftBase extends AdminTmplMthdAftNavBase {
028
029    /**
030     * ITUtil.PORTAL + "?channelTitle=Parameter%20Type&channelUrl=" 
031     * + WebDriverUtils.getBaseUrlString() + ITUtil.KNS_LOOKUP_METHOD + "org.kuali.rice.coreservice.impl.parameter.ParameterTypeBo&docFormKey=88888888&returnLocation=" +
032     * ITUtil.PORTAL_URL + ITUtil.HIDE_RETURN_LINK;
033     */
034    public static final String BOOKMARK_URL = AutomatedFunctionalTestUtils.PORTAL + "?channelTitle=Parameter%20Type&channelUrl="
035            + WebDriverUtils.getBaseUrlString() + AutomatedFunctionalTestUtils.KNS_LOOKUP_METHOD +
036            "org.kuali.rice.coreservice.impl.parameter.ParameterTypeBo&docFormKey=88888888&returnLocation=" +
037            AutomatedFunctionalTestUtils.PORTAL_URL + AutomatedFunctionalTestUtils.HIDE_RETURN_LINK ;
038
039    private String docId;
040    private String parameterType;
041    private String parameterCode;
042
043    @Override
044    protected String getBookmarkUrl() {
045        return BOOKMARK_URL;
046    }
047
048    /**
049     * {@inheritDoc}
050     * Parameter Type
051     * @return
052     */
053    @Override
054    protected String getLinkLocator() {
055        return "Parameter Type";
056    }
057   
058    public void testParameterTypeBookmark(JiraAwareFailable failable) throws Exception {
059     // Create New
060        selectFrame("iframeportlet");
061        waitAndCreateNew();
062        List<String> params;
063        params=testCreateNewParameterType(docId, parameterType,parameterCode);
064        
065        //Lookup
066        open(WebDriverUtils.getBaseUrlString()+BOOKMARK_URL);
067        selectFrame("iframeportlet");
068        params=testLookUpParameterType(params.get(0), params.get(1),params.get(2));
069        
070        //edit
071        params=testEditParameterType(params.get(0), params.get(1),params.get(2));
072
073        //Verify if its edited
074        open(WebDriverUtils.getBaseUrlString()+BOOKMARK_URL);
075        selectFrame("iframeportlet");
076        params=testLookUpParameterType(params.get(0), params.get(1),params.get(2));
077
078        //copy
079        params=testCopyParameterType(params.get(0), params.get(1),params.get(2));
080
081        //Verify if its copied
082        open(WebDriverUtils.getBaseUrlString()+BOOKMARK_URL);
083        selectFrame("iframeportlet");
084        testVerifyCopyParameterType(params.get(0), params.get(1),params.get(2));
085        passed();
086    }
087
088    public void testParameterTypeNav(JiraAwareFailable failable) throws Exception {
089      //Create New
090        gotoCreateNew();
091        List<String> params;
092        params=testCreateNewParameterType(docId, parameterType,parameterCode);
093    
094        //Lookup
095        navigate();
096        selectFrame("iframeportlet");
097        params=testLookUpParameterType(params.get(0), params.get(1),params.get(2));
098
099        //edit
100        params=testEditParameterType(params.get(0), params.get(1),params.get(2));
101        
102        //Verify if its edited
103        navigate();
104        params=testLookUpParameterType(params.get(0), params.get(1),params.get(2));
105
106        //copy
107        params=testCopyParameterType(params.get(0), params.get(1),params.get(2));
108        
109        //Verify if its copied
110        navigate();
111        testVerifyCopyParameterType(params.get(0), params.get(1),params.get(2));
112        passed();
113    }
114}