1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.samplu.admin.test;
17
18 import org.kuali.rice.testtools.selenium.ITUtil;
19 import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
20 import org.junit.Assert;
21 import org.junit.Test;
22 import org.openqa.selenium.By;
23
24
25
26
27
28
29 public class IdentityPersonRole extends WebDriverLegacyITBase{
30
31 public static final String EDIT_URL = ITUtil.getBaseUrlString() + "/kim/identityManagementPersonDocument.do?returnLocation=" + ITUtil.PORTAL_URL_ENCODED + "&principalId=LTID&docTypeName=IdentityManagementPersonDocument&methodToCall=docHandler&command=initiate";
32 public static final String TEST_URL = ITUtil.PORTAL + "?channelTitle=Person&channelUrl=" + ITUtil.getBaseUrlString() +
33 "/kr/lookup.do?methodToCall=start&businessObjectClassName=org.kuali.rice.kim.api.identity.Person&docFormKey=88888888&returnLocation=" +
34 ITUtil.PORTAL_URL + "&hideReturnLink=true";
35 private int userCnt = Integer.valueOf(System.getProperty("test.role.user.cnt", "176"));
36 private int userCntStart = Integer.valueOf(System.getProperty("test.role.user.cnt.start", "0"));
37 private String idBase = System.getProperty("test.role.user.base", "lt");
38 public static final String ADMIN_ROLE_ID = "63";
39 public static final String KRMS_ADMIN_ROLE_ID = "98";
40
41 @Override
42 public void fail(String message) {
43 Assert.fail(message);
44 }
45
46 @Override
47 public String getTestUrl() {
48 return TEST_URL;
49 }
50
51 @Test
52 public void testPersonRole() throws InterruptedException {
53 String id = "";
54 String format = "%0" + (userCnt + "").length() + "d";
55 for(int i = userCntStart; i < userCnt; i++) {
56 id = idBase + String.format(format, i);
57 open(EDIT_URL.replace("LTID", id));
58 checkForIncidentReport();
59 waitAndTypeByName("document.documentHeader.documentDescription", "Admin permissions for " + id);
60
61 selectByName("newAffln.affiliationTypeCode", "Affiliate");
62 selectOptionByName("newAffln.campusCode", "BL");
63 checkByName("newAffln.dflt");
64 waitAndClickByName("methodToCall.addAffln.anchor");
65
66 waitAndClick(By.id("tab-Membership-imageToggle"));
67 waitAndType(By.id("newRole.roleId"), ADMIN_ROLE_ID);
68 driver.findElement(By.name("methodToCall.addRole.anchor")).click();
69
70 waitAndType(By.id("newRole.roleId"), KRMS_ADMIN_ROLE_ID);
71 driver.findElement(By.name("methodToCall.addRole.anchor")).click();
72 waitAndClickByName("methodToCall.blanketApprove");
73 waitForPageToLoad();
74 }
75 passed();
76 }
77 }