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.AdminMenuBlanketAppITBase;
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 ConfigParameterBlanketAppIT extends AdminMenuBlanketAppITBase {
31      @Override
32      protected String getLinkLocator() {
33          return "link=Parameter";
34      }
35  
36      @Override
37      public String blanketApprove() throws Exception {
38   
39          String docId = waitForDocId();
40          waitAndType("//input[@id='document.documentHeader.documentDescription']", "Validation Test Parameter " + ITUtil.DTS_TWO);
41          assertEquals("", getText("methodToCall.cancel"));
42          select("//select[@id='document.newMaintainableObject.namespaceCode']", "label=KR-NS - Kuali Nervous System");
43          
44          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']";
45          waitAndClick(componentLookUp);
46          waitAndClick("//input[@name='methodToCall.search' and @value='search']");
47          waitAndClick("link=return value");
48  
49          String parameterName = "Validation Test Parameter "+ ITUtil.DTS_TWO;
50          waitAndType("//input[@id='document.newMaintainableObject.name']", parameterName);
51          waitAndType("//textarea[@id='document.newMaintainableObject.description']",
52                  "Validation Test Parameter Description " + ITUtil.DTS_TWO);
53          select("//select[@id='document.newMaintainableObject.parameterTypeCode']", "label=Document Validation");
54          waitAndClick("//input[@id='document.newMaintainableObject.evaluationOperatorCodeAllowed']");
55  
56          waitForPageToLoad();
57          return docId;
58      }
59  }