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