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 ParameterAbstractSmokeTestBase extends AdminTmplMthdSTNavBase{
27  
28      /**
29       * ITUtil.PORTAL + "?channelTitle=Parameter&channelUrl=" 
30       * + ITUtil.getBaseUrlString() + ITUtil.KNS_LOOKUP_METHOD + "org.kuali.rice.coreservice.impl.parameter.ParameterBo&docFormKey=88888888&returnLocation=" +
31       * ITUtil.PORTAL_URL + ITUtil.HIDE_RETURN_LINK;
32       */
33      public static final String BOOKMARK_URL = ITUtil.PORTAL + "?channelTitle=Parameter&channelUrl=" 
34              + ITUtil.getBaseUrlString() + ITUtil.KNS_LOOKUP_METHOD +
35              "org.kuali.rice.coreservice.impl.parameter.ParameterBo&docFormKey=88888888&returnLocation=" +
36              ITUtil.PORTAL_URL + ITUtil.HIDE_RETURN_LINK ;
37  
38      private String docId;
39      private String parameterName;
40      
41      /**
42       * {@inheritDoc}
43       * Parameter
44       * @return
45       */
46      @Override
47      protected String getLinkLocator() {
48          return "Parameter";
49      }
50     
51      public void testParameterBookmark(Failable failable) throws Exception {
52          // Create New
53          selectFrame("iframeportlet");
54          waitAndCreateNew();
55          List<String> params;
56          params=testCreateNewParameter(docId, parameterName);
57         
58          //Lookup
59          open(ITUtil.getBaseUrlString()+BOOKMARK_URL);
60          selectFrame("iframeportlet");
61          params=testLookUpParameter(params.get(0), params.get(1));
62     
63          //edit
64          params=testEditParameter(params.get(0), params.get(1));
65          
66          //Verify if its edited
67          open(ITUtil.getBaseUrlString()+BOOKMARK_URL);
68          selectFrame("iframeportlet");
69          params=testVerifyModifiedParameter(params.get(0), params.get(1));
70    
71          //copy
72          params=testCopyParameter(params.get(0), params.get(1));
73          
74          //Verify if its copied
75          open(ITUtil.getBaseUrlString()+BOOKMARK_URL);
76          selectFrame("iframeportlet");
77          testVerifyModifiedParameter(params.get(0), params.get(1));
78          passed();
79      }
80  
81      public void testParameterNav(Failable failable) throws Exception {
82          //Create New
83          gotoCreateNew();
84          List<String> params;
85          params=testCreateNewParameter(docId, parameterName);
86      
87          //Lookup
88          navigate();
89          selectFrame("iframeportlet");
90          params=testLookUpParameter(params.get(0), params.get(1));
91  
92          //edit
93          params=testEditParameter(params.get(0), params.get(1));
94          
95          //Verify if its edited
96          navigate();
97          params=testVerifyModifiedParameter(params.get(0), params.get(1));
98  
99          //copy
100         params=testCopyParameter(params.get(0), params.get(1));
101         
102         //Verify if its copied
103         navigate();
104         testVerifyModifiedParameter(params.get(0), params.get(1));
105         passed();
106     }
107 }