View Javadoc

1   /**
2    * Copyright 2005-2011 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.samplu.admin.test;
17  
18  import static org.junit.Assert.assertEquals;
19  
20  import edu.samplu.common.AdminMenuLegacyITBase;
21  import edu.samplu.common.ITUtil;
22  import edu.samplu.common.WebDriverLegacyITBase;
23  
24  import org.junit.Test;
25  import org.openqa.selenium.By;
26  
27  /**
28   * tests the group section in Rice.
29   * 
30   * @author Kuali Rice Team (rice.collab@kuali.org)
31   */
32  public class GroupLegacyIT extends AdminMenuLegacyITBase {
33      /**
34       * This overridden method ...
35       * 
36       * @see edu.samplu.common.MenuLegacyITBase#getLinkLocator()
37       */
38      @Override
39      protected String getLinkLocator() {
40          return "Group";
41      }
42      @Test
43      public void testAddingBrownGroup() throws Exception {
44          
45          super.gotoCreateNew();
46          waitForPageToLoad();
47          String docId = driver.findElement(By.xpath("//div[@id='headerarea']/div/table/tbody/tr[1]/td[1]")).getText();
48          //Enter details for BrownGroup.
49          waitAndTypeByName("document.documentHeader.documentDescription", "Adding Brown Group");
50          waitAndTypeByName("document.documentHeader.explanation", "I want to add Brown Group to test KIM");
51          selectOptionByName("document.groupNamespace", "KR-IDM");
52          waitForPageToLoad();
53          String groupName = "BrownGroup "+ITUtil.DTS_TWO;
54          waitAndTypeByName("document.groupName", groupName);
55          checkByName("document.active");
56          waitAndClickByXpath("//*[@name='methodToCall.save' and @alt='save']");
57          waitForPageToLoad();
58          assertElementPresentByXpath("//div[contains(div,'Document was successfully saved.')]", "Document is not saved successfully");
59          checkForIncidentReport();
60          //checks it is saved and initiator is admin.
61          assertEquals("SAVED", driver.findElement(By.xpath("//table[@class='headerinfo']/tbody/tr[1]/td[2]")).getText());
62          assertEquals("admin", driver.findElement(By.xpath("//table[@class='headerinfo']/tbody/tr[2]/td[1]/a")).getText());
63          waitAndClickByName("methodToCall.performLookup.(!!org.kuali.rice.kim.impl.identity.PersonImpl!!).(((principalId:member.memberId,principalName:member.memberName))).((``)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;;::::).anchorAssignees");
64          waitForPageToLoad();
65          waitAndClickByXpath("//input[@name='methodToCall.search' and @value='search']");
66          waitForPageToLoad();
67          waitAndClickByLinkText("return value");
68          waitForPageToLoad();
69          waitAndClickByName("methodToCall.addMember.anchorAssignees");
70          waitForPageToLoad();
71          waitAndClickByXpath("//input[@name='methodToCall.save' and @alt='save']");
72          waitAndClickByXpath("//input[@name='methodToCall.route' and @alt='submit']");
73          waitForPageToLoad();
74          assertElementPresentByXpath("//div[contains(div,'Document was successfully submitted.')]", "Document is not submitted successfully");
75          selectTopFrame();
76          waitAndClickByLinkText("Administration");
77          waitForPageToLoad();
78          waitAndClickByLinkText("Group");
79          waitForPageToLoad();
80          selectFrame("iframeportlet");
81          waitAndTypeByName("name", groupName);
82          waitAndClickByXpath("//input[@name='methodToCall.search' and @value='search']");
83          isElementPresentByLinkText(groupName);
84      }
85  
86      
87  }