View Javadoc

1   /**
2    * Copyright 2005-2013 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package edu.sampleu.kim.api.identity;
17  
18  import edu.sampleu.admin.AdminTmplMthdAftNavBase;
19  import org.kuali.rice.testtools.common.JiraAwareFailable;
20  import org.kuali.rice.testtools.selenium.AutomatedFunctionalTestUtils;
21  import org.kuali.rice.testtools.selenium.WebDriverUtils;
22  
23  import java.util.List;
24  
25  /**
26   * @author Kuali Rice Team (rice.collab@kuali.org)
27   */
28  public abstract class PersonAftBase extends AdminTmplMthdAftNavBase {
29  
30      /**
31       * ITUtil.PORTAL + "?channelTitle=Person&channelUrl=" 
32       * + WebDriverUtils.getBaseUrlString() + ITUtil.KNS_LOOKUP_METHOD + "org.kuali.rice.kim.api.identity.Person&docFormKey=88888888&returnLocation=" +
33       * ITUtil.PORTAL_URL + ITUtil.HIDE_RETURN_LINK;
34       */
35      public static final String BOOKMARK_URL = AutomatedFunctionalTestUtils.PORTAL + "?channelTitle=Person&channelUrl="
36              + WebDriverUtils.getBaseUrlString() + AutomatedFunctionalTestUtils.KNS_LOOKUP_METHOD +
37              "org.kuali.rice.kim.api.identity.Person&docFormKey=88888888&returnLocation=" +
38              AutomatedFunctionalTestUtils.PORTAL_URL + AutomatedFunctionalTestUtils.HIDE_RETURN_LINK ;
39  
40      private String docId;
41      private String personName;
42  
43      @Override
44      protected String getBookmarkUrl() {
45          return BOOKMARK_URL;
46      }
47  
48      /**
49       * {@inheritDoc}
50       * Person
51       * @return
52       */
53      @Override
54      protected String getLinkLocator() {
55          return "Person";
56      }
57     
58      public void testPersonBookmark(JiraAwareFailable failable) throws Exception {
59          //Create New Person
60          selectFrame("iframeportlet");
61          waitAndCreateNew();
62          List<String> params;
63          params=testCreateNewPerson(docId, personName);
64          
65          //LookUp Person
66          selectTopFrame();
67          open(WebDriverUtils.getBaseUrlString()+BOOKMARK_URL);
68          selectFrame("iframeportlet");
69          params=testLookUpPerson(params.get(0), params.get(1));
70  
71          //Verify Person
72          testVerifyPerson(params.get(0), params.get(1));
73          passed();
74      }
75  
76      public void testPersonNav(JiraAwareFailable failable) throws Exception {
77          //Create New Person
78          gotoCreateNew();
79          List<String> params;
80          params=testCreateNewPerson(docId, personName);
81          
82          //LookUp Person
83          selectTopFrame();
84          navigate();
85          params=testLookUpPerson(params.get(0), params.get(1));
86  
87          //Verify Person
88          testVerifyPerson(params.get(0), params.get(1));
89          passed();
90      }
91  }