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