View Javadoc

1   /*
2    * Copyright 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/ecl1.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.mainmenu.test;
17  
18  import edu.samplu.common.MainMenuLookupLegacyITBase;
19  import org.junit.Ignore;
20  import org.junit.Test;
21  
22  import java.util.Calendar;
23  
24  /**
25   * tests whether the "Create New Agenda" is working ok 
26   * 
27   * @author Kuali Rice Team (rice.collab@kuali.org)
28   */
29  public class CreateNewAgendaLegacyIT extends MainMenuLookupLegacyITBase {
30      @Override
31      protected String getLinkLocator() {
32          return "Create New Agenda";
33      }
34      
35      @Test
36      public void testCreateNewAgenda() throws Exception {
37          gotoMenuLinkLocator(); // NOT gotoCreateNew because this create new is on the Main Menu screen
38          selectByName("document.newMaintainableObject.dataObject.namespace", "Kuali Rules Test");
39          String agendaName = "Agenda Date :"+ Calendar.getInstance().getTime().toString();
40          waitAndTypeByName("document.newMaintainableObject.dataObject.agenda.name", "Agenda " + agendaName);
41          waitAndTypeByName("document.newMaintainableObject.dataObject.contextName", "Context1");
42          fireEvent("document.newMaintainableObject.dataObject.contextName", "blur");
43          fireEvent("document.newMaintainableObject.dataObject.contextName", "focus");
44          waitForElementPresentByName("document.newMaintainableObject.dataObject.agenda.typeId");                
45          selectByName("document.newMaintainableObject.dataObject.agenda.typeId", "Campus Agenda");
46          waitForElementPresentByName("document.newMaintainableObject.dataObject.customAttributesMap[Campus]");
47          waitAndTypeByName("document.newMaintainableObject.dataObject.customAttributesMap[Campus]", "BL");
48          waitAndClickByXpath("//div[2]/button");
49          waitForPageToLoad();    
50          waitAndClickByXpath("//div[2]/button[3]");
51          waitForPageToLoad();
52          selectTopFrame();
53          waitAndClickByXpath("(//input[@name='imageField'])[2]");
54          passed();
55      }
56  
57      /**
58       * This overridden method ...
59       * 
60       * @see edu.samplu.common.MainMenuLookupLegacyITBase#lookupAssertions()
61       */
62      @Override
63      public void lookupAssertions() {
64          // TODO mmodi - THIS METHOD NEEDS JAVADOCS
65          // none yet
66      }
67      
68      @Ignore // link to create new is off the main menu    
69      @Test
70      @Override
71      public void testLookUp() throws Exception {}
72     
73  }