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