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.ITUtil;
20  
21  import static org.junit.Assert.assertEquals;
22  
23  /**
24   * tests that user admin's blanket approve of the Parameter maintenance document results in a final document
25   * The component is chosen from a lookup screen
26   * 
27   * @author Kuali Rice Team (rice.collab@kuali.org)
28   */
29  
30  public class ConfigParameterBlanketLegacyAppIT extends AdminMenuBlanketAppLegacyITBase {
31      @Override
32      protected String getLinkLocator() {
33          return "Parameter";
34      }
35  
36      @Override
37      public String blanketApprove() throws Exception {
38   
39          String docId = waitForDocId();
40          waitAndTypeByXpath("//input[@id='document.documentHeader.documentDescription']", "Validation Test Parameter ");
41          assertBlanketApproveButtonsPresent();
42          assertEquals("", getTextByName("methodToCall.cancel"));
43          selectByXpath("//select[@id='document.newMaintainableObject.namespaceCode']", "KR-NS - Kuali Nervous System");
44          
45          String componentLookUp = "//input[@name='methodToCall.performLookup.(!!org.kuali.rice.coreservice.impl.component.ComponentBo!!).(((code:document.newMaintainableObject.componentCode,namespaceCode:document.newMaintainableObject.namespaceCode,))).((`document.newMaintainableObject.componentCode:code,document.newMaintainableObject.namespaceCode:namespaceCode,`)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;" + getBaseUrlString()+ "/kr/lookup.do;::::).anchor4']";
46          waitAndClickByXpath(componentLookUp);
47          waitAndClickByXpath("//input[@name='methodToCall.search' and @value='search']");
48          waitAndClickByLinkText("return value");
49  
50          String parameterName = "Validation Test Parameter"+ITUtil.DTS;
51          waitAndTypeByXpath("//input[@id='document.newMaintainableObject.name']", parameterName);
52          waitAndTypeByXpath("//textarea[@id='document.newMaintainableObject.description']",
53                  "Validation Test Parameter Description" + ITUtil.DTS);
54          selectByXpath("//select[@id='document.newMaintainableObject.parameterTypeCode']", "Document Validation");
55          waitAndClickByXpath("//input[@id='document.newMaintainableObject.evaluationOperatorCodeAllowed']");
56  
57          waitForPageToLoad();
58          return docId;
59      }
60  }