001    /*
002     * Copyright 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/ecl1.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.mainmenu.test;
017    
018    import edu.samplu.common.MainMenuLookupITBase;
019    import org.junit.Ignore;
020    import org.junit.Test;
021    
022    import java.util.Calendar;
023    
024    /**
025     * tests whether the "Create New Agenda" is working ok 
026     * 
027     * @author Kuali Rice Team (rice.collab@kuali.org)
028     */
029    public class CreateNewAgendaIT extends MainMenuLookupITBase {
030        @Override
031        protected String getLinkLocator() {
032            return "link=Create New Agenda";
033        }
034    
035        @Test
036        public void testCreateNewAgenda() throws Exception {
037            gotoMenuLinkLocator(); // NOT gotoCreateNew because this create new is on the Main Menu screen
038            select("name=document.newMaintainableObject.dataObject.namespace", "label=Kuali Rules Test");
039            String agendaName = "Agenda Date :"+ Calendar.getInstance().getTime().toString();
040            waitAndType("name=document.newMaintainableObject.dataObject.agenda.name", "Agenda " + agendaName);
041            waitAndType("name=document.newMaintainableObject.dataObject.contextName", "Context1");
042            fireEvent("name=document.newMaintainableObject.dataObject.contextName", "blur");
043            fireEvent("name=document.newMaintainableObject.dataObject.contextName", "focus");
044            waitForElementPresent("name=document.newMaintainableObject.dataObject.agenda.typeId",
045                    "https://jira.kuali.org/browse/KULRICE-7924 : KRMS Agenda type select option not rendered w/o using Context lookup");
046            select("name=document.newMaintainableObject.dataObject.agenda.typeId", "label=Campus Agenda");
047            waitForElementPresent("name=document.newMaintainableObject.dataObject.customAttributesMap[Campus]");
048            waitAndType("name=document.newMaintainableObject.dataObject.customAttributesMap[Campus]", "BL");
049            waitAndClick("//div[2]/button");
050            waitForPageToLoad();
051            //selectFrame("relative=up");
052            //waitAndClick("css=div.jGrowl-close");
053            //selectFrame("iframeportlet");
054            waitAndClick("//div[2]/button[3]");
055            waitForPageToLoad();
056            selectWindow("null");
057            waitAndClick("xpath=(//input[@name='imageField'])[2]");
058        }
059    
060        @Ignore // link to create new is off the main menu
061        @Test
062        public void testLookUp() throws Exception {}
063    
064        @Override
065        public void lookupAssertions() {
066            //none yet
067        }
068    }