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