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