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 the group section in Rice.
029 *
030 * @author Kuali Rice Team (rice.collab@kuali.org)
031 */
032 public class GroupLegacyIT extends AdminMenuLegacyITBase {
033 /**
034 * This overridden method ...
035 *
036 * @see edu.samplu.common.MenuLegacyITBase#getLinkLocator()
037 */
038 @Override
039 protected String getLinkLocator() {
040 return "Group";
041 }
042 @Test
043 public void testAddingBrownGroup() throws Exception {
044
045 super.gotoCreateNew();
046 waitForPageToLoad();
047 String docId = driver.findElement(By.xpath("//div[@id='headerarea']/div/table/tbody/tr[1]/td[1]")).getText();
048 //Enter details for BrownGroup.
049 waitAndTypeByName("document.documentHeader.documentDescription", "Adding Brown Group");
050 waitAndTypeByName("document.documentHeader.explanation", "I want to add Brown Group to test KIM");
051 selectOptionByName("document.groupNamespace", "KR-IDM");
052 waitForPageToLoad();
053 String groupName = "BrownGroup "+ITUtil.DTS_TWO;
054 waitAndTypeByName("document.groupName", groupName);
055 checkByName("document.active");
056 waitAndClickByXpath("//*[@name='methodToCall.save' and @alt='save']");
057 waitForPageToLoad();
058 assertElementPresentByXpath("//div[contains(div,'Document was successfully saved.')]", "Document is not saved successfully");
059 checkForIncidentReport();
060 //checks it is saved and initiator is admin.
061 assertEquals("SAVED", driver.findElement(By.xpath("//table[@class='headerinfo']/tbody/tr[1]/td[2]")).getText());
062 assertEquals("admin", driver.findElement(By.xpath("//table[@class='headerinfo']/tbody/tr[2]/td[1]/a")).getText());
063 waitAndClickByName("methodToCall.performLookup.(!!org.kuali.rice.kim.impl.identity.PersonImpl!!).(((principalId:member.memberId,principalName:member.memberName))).((``)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;;::::).anchorAssignees");
064 waitForPageToLoad();
065 waitAndClickByXpath("//input[@name='methodToCall.search' and @value='search']");
066 waitForPageToLoad();
067 waitAndClickByLinkText("return value");
068 waitForPageToLoad();
069 waitAndClickByName("methodToCall.addMember.anchorAssignees");
070 waitForPageToLoad();
071 waitAndClickByXpath("//input[@name='methodToCall.save' and @alt='save']");
072 waitAndClickByXpath("//input[@name='methodToCall.route' and @alt='submit']");
073 waitForPageToLoad();
074 assertElementPresentByXpath("//div[contains(div,'Document was successfully submitted.')]", "Document is not submitted successfully");
075 selectTopFrame();
076 waitAndClickByLinkText("Administration");
077 waitForPageToLoad();
078 waitAndClickByLinkText("Group");
079 waitForPageToLoad();
080 selectFrame("iframeportlet");
081 waitAndTypeByName("name", groupName);
082 waitAndClickByXpath("//input[@name='methodToCall.search' and @value='search']");
083 isElementPresentByLinkText(groupName);
084 }
085
086
087 }