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  
21  /**
22   * @author Kuali Rice Team (rice.collab@kuali.org)
23   */
24  public abstract class IdentityPersonLookUpEditAbstractSmokeTestBase extends AdminTmplMthdSTNavBase{
25  
26      /**
27       * ITUtil.PORTAL + "?channelTitle=Person&channelUrl=" 
28       * + ITUtil.getBaseUrlString() + ITUtil.KNS_LOOKUP_METHOD + "org.kuali.rice.kim.api.identity.Person&docFormKey=88888888&returnLocation=" +
29       * ITUtil.PORTAL_URL + ITUtil.HIDE_RETURN_LINK;
30       */    
31  //    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
32      public static final String BOOKMARK_URL = ITUtil.PORTAL + "?channelTitle=Person&channelUrl=" 
33              + ITUtil.getBaseUrlString() + "/kr/lookup.do?methodToCall=start&businessObjectClassName=org.kuali.rice.kim.api.identity.Person&docFormKey=88888888&returnLocation="+
34              ITUtil.PORTAL_URL + ITUtil.HIDE_RETURN_LINK ;
35  
36      /**
37       * {@inheritDoc}
38       * Person
39       * @return
40       */
41      @Override
42      protected String getLinkLocator() {
43          return "Person";
44      }
45     
46      public void testIdentityPersonLookUpEditBookmark(Failable failable) throws Exception {
47          testIdentityPersonLookUpEdit();
48          passed();
49      }
50  
51      public void testIdentityPersonLookUpEditNav(Failable failable) throws Exception {
52          testIdentityPersonLookUpEdit();
53          passed();
54      }
55      
56      public void testIdentityPersonLookUpEdit() throws Exception {
57          // This tests only runs correctly the first time.
58          selectFrameIframePortlet();
59          waitAndTypeByName("principalName","fran");
60          waitAndClickByXpath("(//input[@name='methodToCall.search'])[2]");
61          selectFrameIframePortlet();
62          waitAndClickByXpath("//a[@title='edit Person withPrincipal ID=fran ']");
63          waitAndTypeByName("document.documentHeader.documentDescription", "Test description of person");
64          selectByName("newAffln.affiliationTypeCode", "Staff");
65          selectByName("newAffln.campusCode","BL - BLOOMINGTON");
66          waitAndClickByName("newAffln.dflt");
67          waitAndClickByName("methodToCall.addAffln.anchor");
68          waitAndTypeByName("document.affiliations[0].newEmpInfo.employeeId","9999999999");
69          waitAndClickByName("document.affiliations[0].newEmpInfo.primary");
70          selectByName("document.affiliations[0].newEmpInfo.employmentStatusCode","Active");
71          selectByName("document.affiliations[0].newEmpInfo.employmentTypeCode","Professional");
72          waitAndTypeByName("document.affiliations[0].newEmpInfo.baseSalaryAmount","99999");
73          waitAndTypeByXpath("//*[@id='document.affiliations[0].newEmpInfo.primaryDepartmentCode']", "BL-BUS");
74          waitAndClickByName("methodToCall.addEmpInfo.line0.anchor");
75          waitAndClickByName("methodToCall.showAllTabs");
76          waitAndClickByName("methodToCall.route");
77  
78          if (hasDocError()) {
79              // After the second run of this test, there will be 3 Errors.  Requires a decent amount of work to satisfy constraints.
80              if (!extractErrorText().startsWith("3 error(s) found on page")) {
81                  checkForDocError();
82              }
83          } else {
84              assertTextPresent("Document was successfully submitted.");
85          }
86          waitAndClickByName("methodToCall.close");
87          waitAndClickByName("methodToCall.processAnswer.button1");        
88      }
89  }