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 */
016package edu.samplu.admin.test;
017
018import java.util.List;
019
020import edu.samplu.common.Failable;
021import edu.samplu.common.ITUtil;
022
023/**
024 * @author Kuali Rice Team (rice.collab@kuali.org)
025 */
026public abstract class PermissionAbstractSmokeTestBase extends AdminTmplMthdSTNavBase{
027
028    /**
029     * ITUtil.PORTAL + "?channelTitle=Permission&channelUrl=" 
030     * + ITUtil.getBaseUrlString() + ITUtil.KNS_LOOKUP_METHOD + "org.kuali.rice.kim.impl.permission.UberPermissionBo&docFormKey=88888888&returnLocation=" +
031     * ITUtil.PORTAL_URL + ITUtil.HIDE_RETURN_LINK;
032     */
033    public static final String BOOKMARK_URL = ITUtil.PORTAL + "?channelTitle=Permission&channelUrl=" 
034            + ITUtil.getBaseUrlString() + ITUtil.KNS_LOOKUP_METHOD +
035            "org.kuali.rice.kim.impl.permission.UberPermissionBo&docFormKey=88888888&returnLocation=" +
036            ITUtil.PORTAL_URL + ITUtil.HIDE_RETURN_LINK ;
037
038    private String docId;
039    private String permissionName;
040    
041    /**
042     * {@inheritDoc}
043     * Permission
044     * @return
045     */
046    @Override
047    protected String getLinkLocator() {
048        return "Permission";
049    }
050   
051    public void testPermissionBookmark(Failable failable) throws Exception {
052      //Create New Permission
053        selectFrame("iframeportlet");
054        waitAndCreateNew();
055        List<String> params;
056        params=testCreateNewPermission(docId, permissionName);
057       
058        //LookUp Permission
059        selectTopFrame();
060        open(ITUtil.getBaseUrlString()+BOOKMARK_URL);
061        selectFrame("iframeportlet");
062        params=testLookUpPermission(params.get(0), params.get(1));
063
064        //Edit Permission
065        params=testEditPermission(params.get(0), params.get(1));
066        
067        //Verify Permission
068        selectTopFrame();
069        open(ITUtil.getBaseUrlString()+BOOKMARK_URL);
070        selectFrame("iframeportlet");
071        params=testVerifyPermission(params.get(0), params.get(1));
072        passed();
073    }
074
075    public void testPermissionNav(Failable failable) throws Exception {
076        //Create New
077        gotoCreateNew();
078        List<String> params;
079        params = testCreateNewPermission(docId, permissionName);
080
081        //LookUp Permission
082        selectTopFrame();
083        navigate();
084        params = testLookUpPermission(params.get(0), params.get(1));
085
086        //Edit Permission
087        params = testEditPermission(params.get(0), params.get(1));
088
089        //Verify Permisstion
090        selectTopFrame();
091        navigate();
092        params = testVerifyPermission(params.get(0), params.get(1));
093        passed();
094    }
095}