001/** 002 * Copyright 2005-2014 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.kuali.rice.testtools.common.JiraAwareFailable; 019import org.kuali.rice.testtools.selenium.AutomatedFunctionalTestUtils; 020import org.kuali.rice.testtools.selenium.WebDriverUtils; 021import org.openqa.selenium.By; 022 023/** 024 * @author Kuali Rice Team (rice.collab@kuali.org) 025 */ 026public abstract class AddingNameSpacesAftBase extends AdminTmplMthdAftNavBase { 027 028 /** 029 * ITUtil.PORTAL+"?channelTitle=Namespace&channelUrl="+WebDriverUtils.getBaseUrlString()+"/kr/lookup.do?methodToCall=start&businessObjectClassName=org.kuali.rice.coreservice.impl.namespace.NamespaceBo&docFormKey=88888888&returnLocation="+ITUtil.PORTAL_URL+"&hideReturnLink=true"; 030 */ 031 public static final String BOOKMARK_URL = AutomatedFunctionalTestUtils.PORTAL+"?channelTitle=Namespace&channelUrl="+ WebDriverUtils 032 .getBaseUrlString()+"/kr/lookup.do?methodToCall=start&businessObjectClassName=org.kuali.rice.coreservice.impl.namespace.NamespaceBo&docFormKey=88888888&returnLocation="+ AutomatedFunctionalTestUtils.PORTAL_URL+"&hideReturnLink=true"; 033 034 @Override 035 protected String getBookmarkUrl() { 036 return BOOKMARK_URL; 037 } 038 039 /** 040 * {@inheritDoc} 041 * Namespace 042 * @return 043 */ 044 @Override 045 protected String getLinkLocator() { 046 return "Namespace"; 047 } 048 049 public void testAddingNamespaceBookmark(JiraAwareFailable failable) throws Exception { 050 testAddingNamespace(this); 051 passed(); 052 } 053 054 public void testAddingNamespaceNav(JiraAwareFailable failable) throws Exception { 055 testAddingNamespace(this); 056 passed(); 057 } 058 059 public void testSearchEditBackNav(JiraAwareFailable failable) throws Exception { 060 testSearchEditBack(this); 061 passed(); 062 } 063 064 public void testSearchSearchBackNav(JiraAwareFailable failable) throws Exception { 065 testSearchSearchBack(this, "code", "KR-SYS"); 066 passed(); 067 } 068 069 protected void testAddingNamespace(JiraAwareFailable failable) throws Exception { 070 selectFrameIframePortlet(); 071 waitAndCreateNew(); 072 waitForElementPresentByXpath(SAVE_XPATH_2, "save button does not exist on the page"); 073 074 //Enter details for Namespace. 075 waitAndTypeByXpath(DOC_DESCRIPTION_XPATH, "Adding PEANUTS"); 076 waitAndTypeByXpath("//*[@id='document.documentHeader.explanation']", "I want to add PEANUTS to test KIM"); 077 waitAndTypeByXpath(DOC_CODE_XPATH, "PEANUTS"); 078 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.name']", "The Peanuts Gang"); 079 checkByXpath("//input[@id='document.newMaintainableObject.active']"); 080 waitAndClickByXpath(SAVE_XPATH_2); 081 waitForElementPresentByXpath(SAVE_SUCCESSFUL_XPATH, "Document is not saved successfully"); 082 083 //checks it is saved and initiator is admin. 084 assertEquals(DOC_STATUS_SAVED, findElement(By.xpath("//table[@class='headerinfo']/tbody/tr[1]/td[2]")).getText()); 085 assertEquals("admin", findElement(By.xpath("//table[@class='headerinfo']/tbody/tr[2]/td[1]/a")).getText()); 086 } 087}