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