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.samplu.admin.test;
17  
18  import java.util.List;
19  
20  import edu.samplu.common.Failable;
21  import edu.samplu.common.ITUtil;
22  
23  /**
24   * @author Kuali Rice Team (rice.collab@kuali.org)
25   */
26  public abstract class PermissionAbstractSmokeTestBase extends AdminTmplMthdSTNavBase{
27  
28      /**
29       * ITUtil.PORTAL + "?channelTitle=Permission&channelUrl=" 
30       * + ITUtil.getBaseUrlString() + ITUtil.KNS_LOOKUP_METHOD + "org.kuali.rice.kim.impl.permission.UberPermissionBo&docFormKey=88888888&returnLocation=" +
31       * ITUtil.PORTAL_URL + ITUtil.HIDE_RETURN_LINK;
32       */
33      public static final String BOOKMARK_URL = ITUtil.PORTAL + "?channelTitle=Permission&channelUrl=" 
34              + ITUtil.getBaseUrlString() + ITUtil.KNS_LOOKUP_METHOD +
35              "org.kuali.rice.kim.impl.permission.UberPermissionBo&docFormKey=88888888&returnLocation=" +
36              ITUtil.PORTAL_URL + ITUtil.HIDE_RETURN_LINK ;
37  
38      private String docId;
39      private String permissionName;
40      
41      /**
42       * {@inheritDoc}
43       * Permission
44       * @return
45       */
46      @Override
47      protected String getLinkLocator() {
48          return "Permission";
49      }
50     
51      public void testPermissionBookmark(Failable failable) throws Exception {
52        //Create New Permission
53          selectFrame("iframeportlet");
54          waitAndCreateNew();
55          List<String> params;
56          params=testCreateNewPermission(docId, permissionName);
57         
58          //LookUp Permission
59          selectTopFrame();
60          open(ITUtil.getBaseUrlString()+BOOKMARK_URL);
61          selectFrame("iframeportlet");
62          params=testLookUpPermission(params.get(0), params.get(1));
63  
64          //Edit Permission
65          params=testEditPermission(params.get(0), params.get(1));
66          
67          //Verify Permission
68          selectTopFrame();
69          open(ITUtil.getBaseUrlString()+BOOKMARK_URL);
70          selectFrame("iframeportlet");
71          params=testVerifyPermission(params.get(0), params.get(1));
72          passed();
73      }
74  
75      public void testPermissionNav(Failable failable) throws Exception {
76          //Create New
77          gotoCreateNew();
78          List<String> params;
79          params = testCreateNewPermission(docId, permissionName);
80  
81          //LookUp Permission
82          selectTopFrame();
83          navigate();
84          params = testLookUpPermission(params.get(0), params.get(1));
85  
86          //Edit Permission
87          params = testEditPermission(params.get(0), params.get(1));
88  
89          //Verify Permisstion
90          selectTopFrame();
91          navigate();
92          params = testVerifyPermission(params.get(0), params.get(1));
93          passed();
94      }
95  }