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