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.AdminMenuBlanketAppLegacyITBase;
19  import edu.samplu.common.AdminMenuLegacyITBase;
20  import edu.samplu.common.ITUtil;
21  import org.apache.commons.lang.RandomStringUtils;
22  
23  /**
24   * tests that user 'admin', on blanket approving a new County maintenance document, results in a final document
25   * 
26   * @author Kuali Rice Team (rice.collab@kuali.org)
27   */
28  public class LocationCountyBlanketAppLegacyIT extends AdminMenuBlanketAppLegacyITBase {
29      
30      @Override
31      protected String getLinkLocator() {
32          return "County";
33      }
34  
35     @Override
36     public String blanketApprove() throws Exception {
37          String docId = waitForDocId();
38          waitAndTypeByXpath("//input[@id='document.documentHeader.documentDescription']", "Validation Test County");
39          assertBlanketApproveButtonsPresent();
40          String countryLookUp = "//input[@name='methodToCall.performLookup.(!!org.kuali.rice.location.impl.country.CountryBo!!).(((code:document.newMaintainableObject.countryCode,))).((`document.newMaintainableObject.countryCode:code,`)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;" + getBaseUrlString()+ "/kr/lookup.do;::::).anchor4']";
41          waitAndClickByXpath(countryLookUp);
42          waitAndTypeByName("code", "US");        
43          waitAndClickByXpath("//input[@name='methodToCall.search' and @value='search']");
44          waitAndClickByLinkText("return value");
45          waitAndTypeByXpath("//input[@id='document.newMaintainableObject.code']", RandomStringUtils.randomAlphabetic(2).toUpperCase());
46          String stateLookUp = "//input[@name='methodToCall.performLookup.(!!org.kuali.rice.location.impl.state.StateBo!!).(((countryCode:document.newMaintainableObject.countryCode,code:document.newMaintainableObject.stateCode,))).((`document.newMaintainableObject.countryCode:countryCode,document.newMaintainableObject.stateCode:code,`)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;" + getBaseUrlString() + "/kr/lookup.do;::::).anchor4']";
47          waitAndClickByXpath(stateLookUp);
48          waitAndTypeByName("code", "IN");
49          waitAndClickByXpath("//input[@name='methodToCall.search' and @value='search']");
50          waitAndClickByLinkText("return value");
51          String countyName = "Validation Test County"+ITUtil.DTS;
52          waitAndTypeByXpath("//input[@id='document.newMaintainableObject.name']", countyName);
53          waitAndClickByXpath("//input[@id='document.newMaintainableObject.active']");
54          return docId;  
55      }
56  }
57