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 edu.samplu.common.Failable;
19  import edu.samplu.common.ITUtil;
20  import edu.samplu.common.WebDriverLegacyITBase;
21  
22  /**
23   * Tests the Component section in Rice.
24   *
25   * @author Kuali Rice Team (rice.collab@kuali.org)
26   */
27  public abstract class ComponentAbstractSmokeTestBase extends WebDriverLegacyITBase {
28      String docId;
29  
30      /**
31       * ITUtil.PORTAL + "?channelTitle=Component&channelUrl=" + ITUtil.getBaseUrlString() +
32       "/kr/lookup.do?methodToCall=start&businessObjectClassName=org.kuali.rice.coreservice.impl.component.ComponentBo&docFormKey=88888888&returnLocation=" +
33       ITUtil.PORTAL_URL + "&hideReturnLink=true";
34       */
35      public static final String BOOKMARK_URL = ITUtil.PORTAL + "?channelTitle=Component&channelUrl=" + ITUtil.getBaseUrlString() +
36              "/kr/lookup.do?methodToCall=start&businessObjectClassName=org.kuali.rice.coreservice.impl.component.ComponentBo&docFormKey=88888888&returnLocation=" +
37              ITUtil.PORTAL_URL + "&hideReturnLink=true";
38  
39      protected void bookmark() {
40          open(ITUtil.getBaseUrlString() + BOOKMARK_URL);
41      }
42  
43      /**
44       * Bookmark tests should call bookmark(), navigation tests should call navigation()
45       * @throws Exception
46       */
47      protected abstract void gotoTest() throws Exception;
48  
49      protected void navigtaion() throws InterruptedException {
50          waitAndClickAdministration(this);
51          waitForTitleToEqualKualiPortalIndex();
52          checkForIncidentReport("Component");
53          selectFrameIframePortlet();
54          waitAndClickByLinkText("Component");
55  //        selectFrame("relative=up");
56          checkForIncidentReport("Component");
57      }
58  
59      protected void testComponentCreateNewCancelBookmark(Failable failable) throws Exception {
60          waitAndCreateNew();
61          testCancelConfirmation();
62          passed();
63      }
64  
65      protected void testComponentCreateNewCancelNav(Failable failable) throws Exception {
66          navigtaion(); // setUp only takes us to the portal, need to navigate to the test
67          waitAndCreateNew();
68          testCancelConfirmation();
69          passed();
70      }
71  
72      protected void testComponentParameterBookmark(Failable failable) throws Exception {
73          testComponentParameter();
74          passed();
75      }
76  
77      protected void testComponentParameterNav(Failable failable) throws Exception {
78          navigtaion(); // setUp only takes us to the portal, need to navigate to the test
79          testComponentParameter();
80          passed();
81      }
82  
83      protected void testComponentParameter() throws Exception {
84          //Create New
85          waitAndCreateNew();
86          String componentName = "TestName" + ITUtil.DTS_TWO;
87          String componentCode = "TestCode" + ITUtil.DTS_TWO;
88          docId = testCreateNewComponent(componentName, componentCode);
89  
90          //Lookup
91          gotoTest();
92          testLookUpComponent(docId, componentName, componentCode);
93  
94          //edit
95          testEditComponent(docId, componentName, componentCode);
96  
97          //Verify if its edited
98          gotoTest();
99          testVerifyEditedComponent(docId, componentName, componentCode);
100 
101         //copy
102         testCopyComponent(docId, componentName + "copy", componentCode + "copy");
103 
104         //Verify if its copied
105         gotoTest();
106         testVerifyCopyComponent(docId, componentName + "copy", componentCode + "copy");
107     }
108 }