001/** 002 * Copyright 2005-2015 The Kuali Foundation 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package edu.sampleu.admin; 017 018import org.junit.Test; 019import org.kuali.rice.testtools.selenium.AutomatedFunctionalTestUtils; 020import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase; 021import org.kuali.rice.testtools.selenium.WebDriverUtils; 022 023/** 024 * Tests the Component section in Rice. 025 * 026 * @author Kuali Rice Team (rice.collab@kuali.org) 027 */ 028public class ComponentAft extends ConfigComponentAftBase { 029 030 String docId; 031 032 /** 033 * ITUtil.PORTAL + "?channelTitle=Component&channelUrl=" + WebDriverUtils.getBaseUrlString() + 034 "/kr/lookup.do?methodToCall=start&businessObjectClassName=org.kuali.rice.coreservice.impl.component.ComponentBo&docFormKey=88888888&returnLocation=" + 035 ITUtil.PORTAL_URL + "&hideReturnLink=true"; 036 */ 037 public static final String BOOKMARK_URL = AutomatedFunctionalTestUtils.PORTAL + "?channelTitle=Component&channelUrl=" + WebDriverUtils 038 .getBaseUrlString() +"/kr/lookup.do?methodToCall=start&businessObjectClassName=org.kuali.rice.coreservice.impl.component.ComponentBo&docFormKey=88888888&returnLocation=" + 039 AutomatedFunctionalTestUtils.PORTAL_URL + "&hideReturnLink=true"; 040 041 @Override 042 protected String getBookmarkUrl() { 043 return BOOKMARK_URL; 044 } 045 046 protected void testComponentParameter() throws Exception { 047 //Create New 048 namespaceCode = "KR-IDM"; 049 uniqueString = AutomatedFunctionalTestUtils.createUniqueDtsPlusTwoRandomCharsNot9Digits(); 050 String componentName = "name" + uniqueString; // same pattern as used in testCreateNewEnterDetails 051 String componentCode = "code" + uniqueString; // same pattern as used in testCreateNewEnterDetails 052 docId = testCreateNew(); 053 submitAndClose(); 054 055 //Lookup 056 navigate(); 057 testLookUpComponent(docId, componentName, componentCode); 058 059 //edit 060 testEditComponent(docId, componentName, componentCode); 061 062 //Verify if its edited 063 navigate(); 064 testVerifyEditedComponent(docId, componentName, componentCode); 065 066 //copy 067 testCopyComponent(docId, componentName + "copy", componentCode + "copy"); 068 069 //Verify if its copied 070 navigate(); 071 testVerifyCopyComponent(docId, componentName + "copy", componentCode + "copy"); 072 passed(); 073 } 074 075 @Test 076 public void testComponentParameterBookmark() throws Exception { 077 testComponentParameter(); 078 } 079 080 @Test 081 public void testComponentParameterNav() throws Exception { 082 testComponentParameter(); 083 } 084}