View Javadoc
1   /**
2    * Copyright 2005-2014 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.admin;
17  
18  import org.kuali.rice.testtools.common.JiraAwareFailable;
19  import org.kuali.rice.testtools.selenium.AutomatedFunctionalTestUtils;
20  import org.kuali.rice.testtools.selenium.WebDriverUtils;
21  
22  import java.util.List;
23  
24  /**
25   * @author Kuali Rice Team (rice.collab@kuali.org)
26   */
27  public abstract class ParameterAftBase extends AdminTmplMthdAftNavBase {
28  
29      /**
30       * ITUtil.PORTAL + "?channelTitle=Parameter&channelUrl=" 
31       * + WebDriverUtils.getBaseUrlString() + ITUtil.KNS_LOOKUP_METHOD + "org.kuali.rice.coreservice.impl.parameter.ParameterBo&docFormKey=88888888&returnLocation=" +
32       * ITUtil.PORTAL_URL + ITUtil.HIDE_RETURN_LINK;
33       */
34      public static final String BOOKMARK_URL = AutomatedFunctionalTestUtils.PORTAL + "?channelTitle=Parameter&channelUrl="
35              + WebDriverUtils.getBaseUrlString() + AutomatedFunctionalTestUtils.KNS_LOOKUP_METHOD +
36              "org.kuali.rice.coreservice.impl.parameter.ParameterBo&docFormKey=88888888&returnLocation=" +
37              AutomatedFunctionalTestUtils.PORTAL_URL + AutomatedFunctionalTestUtils.HIDE_RETURN_LINK ;
38  
39      private String docId;
40      private String parameterName;
41  
42      @Override
43      protected String getBookmarkUrl() {
44          return BOOKMARK_URL;
45      }
46  
47      /**
48       * {@inheritDoc}
49       * Parameter
50       * @return
51       */
52      @Override
53      protected String getLinkLocator() {
54          return "Parameter";
55      }
56     
57      public void testParameterBookmark(JiraAwareFailable failable) throws Exception {
58          // Create New
59          selectFrame("iframeportlet");
60          waitAndCreateNew();
61          List<String> params;
62          params=testCreateNewParameter(docId, parameterName);
63         
64          //Lookup
65          open(WebDriverUtils.getBaseUrlString()+BOOKMARK_URL);
66          selectFrame("iframeportlet");
67          params=testLookUpParameter(params.get(0), params.get(1));
68     
69          //edit
70          params=testEditParameter(params.get(0), params.get(1));
71          
72          //Verify if its edited
73          open(WebDriverUtils.getBaseUrlString()+BOOKMARK_URL);
74          selectFrame("iframeportlet");
75          params=testVerifyModifiedParameter(params.get(0), params.get(1));
76    
77          //copy
78          params=testCopyParameter(params.get(0), params.get(1));
79          
80          //Verify if its copied
81          open(WebDriverUtils.getBaseUrlString()+BOOKMARK_URL);
82          selectFrame("iframeportlet");
83          testVerifyModifiedParameter(params.get(0), params.get(1));
84          passed();
85      }
86  
87      public void testParameterNav(JiraAwareFailable failable) throws Exception {
88          //Create New
89          gotoCreateNew();
90          List<String> params;
91          params=testCreateNewParameter(docId, parameterName);
92      
93          //Lookup
94          navigate();
95          selectFrame("iframeportlet");
96          params=testLookUpParameter(params.get(0), params.get(1));
97  
98          //edit
99          params=testEditParameter(params.get(0), params.get(1));
100         
101         //Verify if its edited
102         navigate();
103         params=testVerifyModifiedParameter(params.get(0), params.get(1));
104 
105         //copy
106         params=testCopyParameter(params.get(0), params.get(1));
107         
108         //Verify if its copied
109         navigate();
110         testVerifyModifiedParameter(params.get(0), params.get(1));
111         passed();
112     }
113 }