View Javadoc
1   /**
2    * Copyright 2005-2015 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 PermissionAftBase extends AdminTmplMthdAftNavBase {
29  
30      /**
31       * ITUtil.PORTAL + "?channelTitle=Permission&channelUrl=" 
32       * + WebDriverUtils.getBaseUrlString() + ITUtil.KNS_LOOKUP_METHOD + "org.kuali.rice.kim.impl.permission.UberPermissionBo&docFormKey=88888888&returnLocation=" +
33       * ITUtil.PORTAL_URL + ITUtil.HIDE_RETURN_LINK;
34       */
35      public static final String BOOKMARK_URL = AutomatedFunctionalTestUtils.PORTAL + "?channelTitle=Permission&channelUrl="
36              + WebDriverUtils.getBaseUrlString() + AutomatedFunctionalTestUtils.KNS_LOOKUP_METHOD +
37              "org.kuali.rice.kim.impl.permission.UberPermissionBo&docFormKey=88888888&returnLocation=" +
38              AutomatedFunctionalTestUtils.PORTAL_URL + AutomatedFunctionalTestUtils.HIDE_RETURN_LINK ;
39  
40      private String docId;
41      private String permissionName;
42  
43      @Override
44      protected String getBookmarkUrl() {
45          return BOOKMARK_URL;
46      }
47  
48      /**
49       * {@inheritDoc}
50       * Permission
51       * @return
52       */
53      @Override
54      protected String getLinkLocator() {
55          return "Permission";
56      }
57     
58      public void testPermissionBookmark(JiraAwareFailable failable) throws Exception {
59        //Create New Permission
60          selectFrame("iframeportlet");
61          waitAndCreateNew();
62          List<String> params;
63          params=testCreateNewPermission(docId, permissionName);
64         
65          //LookUp Permission
66          selectTopFrame();
67          open(WebDriverUtils.getBaseUrlString()+BOOKMARK_URL);
68          selectFrame("iframeportlet");
69          params=testLookUpPermission(params.get(0), params.get(1));
70  
71          //Edit Permission
72          params=testEditPermission(params.get(0), params.get(1));
73          
74          //Verify Permission
75          selectTopFrame();
76          open(WebDriverUtils.getBaseUrlString()+BOOKMARK_URL);
77          selectFrame("iframeportlet");
78          params=testVerifyPermission(params.get(0), params.get(1));
79          passed();
80      }
81  
82      public void testPermissionNav(JiraAwareFailable failable) throws Exception {
83          //Create New
84          gotoCreateNew();
85          List<String> params;
86          params = testCreateNewPermission(docId, permissionName);
87  
88          //LookUp Permission
89          selectTopFrame();
90          navigate();
91          params = testLookUpPermission(params.get(0), params.get(1));
92  
93          //Edit Permission
94          params = testEditPermission(params.get(0), params.get(1));
95  
96          //Verify Permisstion
97          selectTopFrame();
98          navigate();
99          params = testVerifyPermission(params.get(0), params.get(1));
100         passed();
101     }
102 }