View Javadoc

1   /**
2    * Copyright 2005-2013 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.Failable;
19  import edu.samplu.common.ITUtil;
20  import org.apache.commons.lang.RandomStringUtils;
21  
22  /**
23   * @author Kuali Rice Team (rice.collab@kuali.org)
24   */
25  public abstract class IdentityPersonCreateNewAbstractSmokeTestBase extends AdminTmplMthdSTNavBase{
26  
27      /**
28       * ITUtil.PORTAL + "?channelTitle=Person&channelUrl=" 
29       * + ITUtil.getBaseUrlString() + ITUtil.KNS_LOOKUP_METHOD + "org.kuali.rice.kim.api.identity.Person&docFormKey=88888888&returnLocation=" +
30       * ITUtil.PORTAL_URL + ITUtil.HIDE_RETURN_LINK;
31       */    
32  //    http://env2.rice.kuali.org/portal.do?channelTitle=Person&channelUrl=http://env2.rice.kuali.org/kr/lookup.do?methodToCall=start&businessObjectClassName=org.kuali.rice.kim.api.identity.Person&docFormKey=88888888&returnLocation=http://env2.rice.kuali.org/portal.do&hideReturnLink=true
33      public static final String BOOKMARK_URL = ITUtil.PORTAL + "?channelTitle=Person&channelUrl=" 
34              + ITUtil.getBaseUrlString() + "/kr/lookup.do?methodToCall=start&businessObjectClassName=org.kuali.rice.kim.api.identity.Person&docFormKey=88888888&returnLocation="+
35              ITUtil.PORTAL_URL + ITUtil.HIDE_RETURN_LINK ;
36  
37      /**
38       * {@inheritDoc}
39       * Person
40       * @return
41       */
42      @Override
43      protected String getLinkLocator() {
44          return "Person";
45      }
46     
47      public void testIdentityPersonCreateNewBookmark(Failable failable) throws Exception {
48          testIdentityPersonCreateNew();
49      }
50  
51      public void testIdentityPersonCreateNewNav(Failable failable) throws Exception {
52          testIdentityPersonCreateNew();
53      }
54      
55      public void testIdentityPersonCreateNew() throws Exception {
56          selectFrameIframePortlet();
57          waitAndClickByXpath(CREATE_NEW_XPATH);
58          waitAndTypeByName("document.documentHeader.documentDescription", "Test description of person");
59          selectByName("newAffln.affiliationTypeCode", "Staff");
60          selectByName("newAffln.campusCode","BL - BLOOMINGTON");
61          waitAndClickByName("newAffln.dflt");
62          waitAndClickByName("methodToCall.addAffln.anchor");
63          waitAndTypeByName("document.affiliations[0].newEmpInfo.employeeId","9999999999");
64          waitAndClickByName("document.affiliations[0].newEmpInfo.primary");
65          selectByName("document.affiliations[0].newEmpInfo.employmentStatusCode","Active");
66          selectByName("document.affiliations[0].newEmpInfo.employmentTypeCode","Professional");
67          waitAndTypeByName("document.affiliations[0].newEmpInfo.baseSalaryAmount","99999");
68          waitAndTypeByXpath("//*[@id='document.affiliations[0].newEmpInfo.primaryDepartmentCode']", "BL-BUS");
69          waitAndClickByName("methodToCall.addEmpInfo.line0.anchor");
70          waitAndClickByName("methodToCall.showAllTabs");
71          selectByName("newName.nameCode", "Primary");
72          waitAndTypeByName("newName.firstName","Marco");
73          waitAndTypeByName("newName.lastName","Simoncelli");
74          waitAndClickByName("newName.dflt");
75          waitAndClickByName("methodToCall.addName.anchor");
76          selectByName("newAddress.addressTypeCode", "Work");
77          waitAndTypeByName("newAddress.line1","123 Address Ln");
78          waitAndTypeByName("newAddress.city","Bloomington");
79          selectByName("newAddress.stateProvinceCode", "INDIANA");
80          waitAndTypeByName("newAddress.postalCode","47408");
81          selectByName("newAddress.countryCode","United States");
82          waitAndClickByName("newAddress.dflt");
83          waitAndClickByName("methodToCall.addAddress.anchor");
84          selectByName("newPhone.phoneTypeCode","Work");
85          waitAndTypeByName("newPhone.phoneNumber", "855-555-5555");
86          selectByName("newPhone.countryCode","United States");
87          waitAndClickByName("newPhone.dflt");
88          waitAndClickByName("methodToCall.addPhone.anchor");
89          waitAndTypeByName("newEmail.emailAddress","email@provider.net");
90          selectByName("newEmail.emailTypeCode","Work");
91          waitAndClickByName("newEmail.dflt");
92          waitAndClickByName("methodToCall.addEmail.anchor");
93          waitAndTypeByName("document.principalName", RandomStringUtils.randomAlphabetic(12).toLowerCase());
94                  
95          //Expand All , Submit , Close and Don't Save.        
96          waitAndClickByName("methodToCall.route");
97          checkForDocError();
98  //        assertTextPresent("Document was successfully submitted.");
99          waitAndClickByName("methodToCall.close");
100         waitAndClickByName("methodToCall.processAnswer.button1");        
101     }
102 }