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.MainMenuLookupLegacyITBase;
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 CreateNewAgendaLegacyIT extends MainMenuLookupLegacyITBase {
030        @Override
031        protected String getLinkLocator() {
032            return "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            selectByName("document.newMaintainableObject.dataObject.namespace", "Kuali Rules Test");
039            String agendaName = "Agenda Date :"+ Calendar.getInstance().getTime().toString();
040            waitAndTypeByName("document.newMaintainableObject.dataObject.agenda.name", "Agenda " + agendaName);
041            waitAndTypeByName("document.newMaintainableObject.dataObject.contextName", "Context1");
042            fireEvent("document.newMaintainableObject.dataObject.contextName", "blur");
043            fireEvent("document.newMaintainableObject.dataObject.contextName", "focus");
044            waitForElementPresentByName("document.newMaintainableObject.dataObject.agenda.typeId");                
045            selectByName("document.newMaintainableObject.dataObject.agenda.typeId", "Campus Agenda");
046            waitForElementPresentByName("document.newMaintainableObject.dataObject.customAttributesMap[Campus]");
047            waitAndTypeByName("document.newMaintainableObject.dataObject.customAttributesMap[Campus]", "BL");
048            waitAndClickByXpath("//div[2]/button");
049            waitForPageToLoad();    
050            waitAndClickByXpath("//div[2]/button[3]");
051            waitForPageToLoad();
052            selectTopFrame();
053            waitAndClickByXpath("(//input[@name='imageField'])[2]");
054            passed();
055        }
056    
057        /**
058         * This overridden method ...
059         * 
060         * @see edu.samplu.common.MainMenuLookupLegacyITBase#lookupAssertions()
061         */
062        @Override
063        public void lookupAssertions() {
064            // TODO mmodi - THIS METHOD NEEDS JAVADOCS
065            // none yet
066        }
067        
068        @Ignore // link to create new is off the main menu    
069        @Test
070        @Override
071        public void testLookUp() throws Exception {}
072       
073    }