001 /**
002 * Copyright 2005-2011 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 */
016 package edu.samplu.admin.test;
017
018 import static org.junit.Assert.assertEquals;
019
020 import edu.samplu.common.AdminMenuLegacyITBase;
021 import edu.samplu.common.ITUtil;
022 import edu.samplu.common.WebDriverLegacyITBase;
023
024 import org.junit.Test;
025 import org.openqa.selenium.By;
026
027 /**
028 * tests adding a namespace to Rice.
029 *
030 * @author Kuali Rice Team (rice.collab@kuali.org)
031 */
032 public class AddingNameSpaceLegacyIT extends AdminMenuLegacyITBase {
033 /**
034 * This overridden method ...
035 *
036 * @see edu.samplu.common.MenuLegacyITBase#getLinkLocator()
037 */
038 @Override
039 protected String getLinkLocator() {
040 return "Namespace";
041 }
042 @Test
043 public void testAddingNamespace() throws Exception {
044
045 // assertEquals("Kuali Portal Index", getTitle());
046 // waitAndClickByLinkText("Administration");
047 // waitForPageToLoad();
048 // Thread.sleep(2000);
049 // assertEquals("Kuali Portal Index", getTitle());
050 // waitAndClickByLinkText("Namespace");
051 // waitForPageToLoad();
052 // Thread.sleep(3000);
053 // assertEquals("Kuali Portal Index", getTitle());
054 // selectFrame("iframeportlet");
055 // assertElementPresentByXpath("//img[@alt='create new']","create new button does not exist on the page");
056 // waitAndClickByXpath("//img[@alt='create new']");
057 super.gotoCreateNew();
058 waitForPageToLoad();
059 assertElementPresentByXpath("//*[@name='methodToCall.save' and @alt='save']","save button does not exist on the page");
060 //Enter details for Namespace.
061 waitAndTypeByXpath("//input[@id='document.documentHeader.documentDescription']", "Adding PEANUTS");
062 waitAndTypeByXpath("//*[@id='document.documentHeader.explanation']", "I want to add PEANUTS to test KIM");
063 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.code']", "PEANUTS");
064 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.name']","The Peanuts Gang");
065 checkByXpath("//input[@id='document.newMaintainableObject.active']");
066 waitAndClickByXpath("//*[@name='methodToCall.save' and @alt='save']");
067 waitForPageToLoad();
068 checkForIncidentReport();
069 assertElementPresentByXpath("//div[contains(div,'Document was successfully saved.')]", "Document is not saved successfully");
070 //checks it is saved and initiator is admin.
071 assertEquals("SAVED", driver.findElement(By.xpath("//table[@class='headerinfo']/tbody/tr[1]/td[2]")).getText());
072 assertEquals("admin", driver.findElement(By.xpath("//table[@class='headerinfo']/tbody/tr[2]/td[1]/a")).getText());
073
074 }
075
076
077 }