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 edu.samplu.common.ITUtil;
19  import edu.samplu.common.WebDriverLegacyITBase;
20  import org.junit.Test;
21  import org.openqa.selenium.By;
22  
23  /**
24   * tests creating and cancelling new and edit Role maintenance screens
25   *
26   * @author Kuali Rice Team (rice.collab@kuali.org)
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              checkForIncidentReport();
54              waitAndTypeByName("document.documentHeader.documentDescription", "Admin permissions for " + id); // don't make unique
55  
56              selectByName("newAffln.affiliationTypeCode", "Affiliate");
57              selectOptionByName("newAffln.campusCode", "BL");
58              checkByName("newAffln.dflt");
59              waitAndClickByName("methodToCall.addAffln.anchor");
60  
61              waitAndClick(By.id("tab-Membership-imageToggle"));
62              waitAndType(By.id("newRole.roleId"), ADMIN_ROLE_ID);
63              driver.findElement(By.name("methodToCall.addRole.anchor")).click();
64  
65              waitAndType(By.id("newRole.roleId"), KRMS_ADMIN_ROLE_ID);
66              driver.findElement(By.name("methodToCall.addRole.anchor")).click();
67              waitAndClickByName("methodToCall.blanketApprove");
68              waitForPageToLoad();
69          }
70          passed();
71      }
72  }