001 /**
002 * Copyright 2005-2011 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package edu.samplu.admin.test;
017
018 import static org.junit.Assert.assertEquals;
019 import static org.junit.Assert.assertTrue;
020
021 import edu.samplu.common.UpgradedSeleniumITBase;
022 import org.junit.Test;
023
024 /**
025 * tests that user admin's blanket approve of the Parameter maintenance document results in a final document
026 * The component is chosen from a lookup screen
027 *
028 * @author Kuali Rice Team (rice.collab@kuali.org)
029 */
030 public class ConfigParameterBlanketAppIT extends UpgradedSeleniumITBase {
031 @Override
032 public String getTestUrl() {
033 return PORTAL;
034 }
035
036 @Test
037 public void testParameter() throws Exception {
038 assertEquals("Kuali Portal Index", selenium.getTitle());
039 selenium.click("link=Administration");
040 selenium.waitForPageToLoad("30000");
041 assertEquals("Kuali Portal Index", selenium.getTitle());
042 selenium.click("link=Parameter");
043 selenium.waitForPageToLoad("30000");
044 assertEquals("Kuali Portal Index", selenium.getTitle());
045 selenium.selectFrame("iframeportlet");
046 selenium.click("//img[@alt='create new']");
047 selenium.waitForPageToLoad("30000");
048 String docId = selenium.getText("//div[@id='headerarea']/div/table/tbody/tr[1]/td[1]");
049 assertEquals("", selenium.getText("methodToCall.cancel"));
050 selenium.type("//input[@id='document.documentHeader.documentDescription']", "Validation Test Parameter");
051 selenium.select("//select[@id='document.newMaintainableObject.namespaceCode']", "label=KR-NS - Kuali Nervous System");
052 selenium.click("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,`)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;" + System.getProperty("remote.public.url") + "/kr/lookup.do;::::).anchor4");
053 selenium.waitForPageToLoad("30000");
054 selenium.click("//input[@name='methodToCall.search' and @value='search']");
055 selenium.waitForPageToLoad("30000");
056 selenium.click("//table[@id='row']/tbody/tr[3]/td[1]/a");
057 selenium.waitForPageToLoad("30000");
058 selenium.type("//input[@id='document.newMaintainableObject.name']", "Validation Test Parameter1");
059 selenium.type("//textarea[@id='document.newMaintainableObject.description']", "Validation Test Parameter Description");
060 selenium.select("//select[@id='document.newMaintainableObject.parameterTypeCode']", "label=Document Validation");
061 selenium.click("//input[@id='document.newMaintainableObject.evaluationOperatorCodeAllowed']");
062 selenium.click("methodToCall.blanketApprove");
063 selenium.waitForPageToLoad("30000");
064 selenium.selectWindow("null");
065 selenium.click("//img[@alt='doc search']");
066 selenium.waitForPageToLoad("30000");
067 assertEquals("Kuali Portal Index", selenium.getTitle());
068 selenium.selectFrame("iframeportlet");
069 selenium.click("//input[@name='methodToCall.search' and @value='search']");
070 selenium.waitForPageToLoad("30000");
071 docId= "link=" + docId;
072
073 assertTrue(selenium.isElementPresent(docId));
074 if(selenium.isElementPresent(docId)){
075 assertEquals("FINAL", selenium.getText("//table[@id='row']/tbody/tr[1]/td[4]"));
076 }else{
077 assertEquals(docId, selenium.getText("//table[@id='row']/tbody/tr[1]/td[1]"));
078 assertEquals("FINAL", selenium.getText("//table[@id='row']/tbody/tr[1]/td[4]"));
079 }
080 }
081 }