View Javadoc
1   /**
2    * Copyright 2005-2016 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 ConfigComponentAftBase {
29  
30      String docId;
31  
32      /**
33       * ITUtil.PORTAL + "?channelTitle=Component&channelUrl=" + WebDriverUtils.getBaseUrlString() +
34       "/kr/lookup.do?methodToCall=start&businessObjectClassName=org.kuali.rice.coreservice.impl.component.ComponentBo&docFormKey=88888888&returnLocation=" +
35       ITUtil.PORTAL_URL + "&hideReturnLink=true";
36       */
37      public static final String BOOKMARK_URL = AutomatedFunctionalTestUtils.PORTAL + "?channelTitle=Component&channelUrl=" + WebDriverUtils
38              .getBaseUrlString() +"/kr/lookup.do?methodToCall=start&businessObjectClassName=org.kuali.rice.coreservice.impl.component.ComponentBo&docFormKey=88888888&returnLocation=" +
39              AutomatedFunctionalTestUtils.PORTAL_URL + "&hideReturnLink=true";
40  
41      @Override
42      protected String getBookmarkUrl() {
43          return BOOKMARK_URL;
44      }
45  
46      protected void testComponentParameter() throws Exception {
47          //Create New
48          namespaceCode = "KR-IDM";
49          uniqueString = AutomatedFunctionalTestUtils.createUniqueDtsPlusTwoRandomCharsNot9Digits();
50          String componentName = "name" + uniqueString; // same pattern as used in testCreateNewEnterDetails
51          String componentCode = "code" + uniqueString; // same pattern as used in testCreateNewEnterDetails
52          docId = testCreateNew();
53          submitAndClose();
54  
55          //Lookup
56          navigate();
57          testLookUpComponent(docId, componentName, componentCode);
58  
59          //edit
60          testEditComponent(docId, componentName, componentCode);
61  
62          //Verify if its edited
63          navigate();
64          testVerifyEditedComponent(docId, componentName, componentCode);
65  
66          //copy
67          testCopyComponent(docId, componentName + "copy", componentCode + "copy");
68  
69          //Verify if its copied
70          navigate();
71          testVerifyCopyComponent(docId, componentName + "copy", componentCode + "copy");
72          passed();
73      }
74  
75      @Test
76      public void testComponentParameterBookmark() throws Exception {
77          testComponentParameter();
78      }
79  
80      @Test
81      public void testComponentParameterNav() throws Exception {
82          testComponentParameter();
83      }
84  }