1
2
3
4
5
6
7
8
9
10
11
12
13
14
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
29
30
31
32 public class GroupLegacyIT extends AdminMenuLegacyITBase {
33
34
35
36
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
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
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 }