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 IdentityPersonLookUpEditAbstractSmokeTestBase 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 testIdentityPersonLookUpEditBookmark(Failable failable) throws Exception {
50          testIdentityPersonLookUpEdit();
51      }
52  
53      public void testIdentityPersonLookUpEditNav(Failable failable) throws Exception {
54          gotoMenuLinkLocator();
55          testIdentityPersonLookUpEdit();
56      }
57      
58      public void testIdentityPersonLookUpEdit() throws Exception
59      {
60          selectFrameIframePortlet();
61          waitAndTypeByName("principalName","fran");
62          waitAndClickByXpath("(//input[@name='methodToCall.search'])[2]");
63          selectFrameIframePortlet();
64          waitAndClickByXpath("//a[@title='edit Person withPrincipal ID=fran ']");
65          waitAndTypeByName("document.documentHeader.documentDescription", "Test description of person");
66          selectByName("newAffln.affiliationTypeCode", "Staff");
67          selectByName("newAffln.campusCode","BL - BLOOMINGTON");
68          waitAndClickByName("newAffln.dflt");
69          waitAndClickByName("methodToCall.addAffln.anchor");
70          waitAndTypeByName("document.affiliations[0].newEmpInfo.employeeId","9999999999");
71          waitAndClickByName("document.affiliations[0].newEmpInfo.primary");
72          selectByName("document.affiliations[0].newEmpInfo.employmentStatusCode","Active");
73          selectByName("document.affiliations[0].newEmpInfo.employmentTypeCode","Professional");
74          waitAndTypeByName("document.affiliations[0].newEmpInfo.baseSalaryAmount","99999");
75          waitAndTypeByXpath("//*[@id='document.affiliations[0].newEmpInfo.primaryDepartmentCode']", "BL-BUS");
76          waitAndClickByName("methodToCall.addEmpInfo.line0.anchor");
77          waitAndClickByName("methodToCall.showAllTabs");
78          waitAndClickByName("methodToCall.route");
79  //        assertTextPresent("Document was successfully submitted.");
80          waitAndClickByName("methodToCall.close");
81          waitAndClickByName("methodToCall.processAnswer.button1");        
82      }
83  }