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.MainMenuLookupITBase;
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 CreateNewAgendaIT extends MainMenuLookupITBase {
30      @Override
31      protected String getLinkLocator() {
32          return "link=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          select("name=document.newMaintainableObject.dataObject.namespace", "label=Kuali Rules Test");
39          String agendaName = "Agenda Date :"+ Calendar.getInstance().getTime().toString();
40          waitAndType("name=document.newMaintainableObject.dataObject.agenda.name", "Agenda " + agendaName);
41          waitAndType("name=document.newMaintainableObject.dataObject.contextName", "Context1");
42          fireEvent("name=document.newMaintainableObject.dataObject.contextName", "blur");
43          fireEvent("name=document.newMaintainableObject.dataObject.contextName", "focus");
44          waitForElementPresent("name=document.newMaintainableObject.dataObject.agenda.typeId",
45                  "https://jira.kuali.org/browse/KULRICE-7924 : KRMS Agenda type select option not rendered w/o using Context lookup");
46          select("name=document.newMaintainableObject.dataObject.agenda.typeId", "label=Campus Agenda");
47          waitForElementPresent("name=document.newMaintainableObject.dataObject.customAttributesMap[Campus]");
48          waitAndType("name=document.newMaintainableObject.dataObject.customAttributesMap[Campus]", "BL");
49          waitAndClick("//div[2]/button");
50          waitForPageToLoad();
51          //selectFrame("relative=up");
52          //waitAndClick("css=div.jGrowl-close");
53          //selectFrame("iframeportlet");
54          waitAndClick("//div[2]/button[3]");
55          waitForPageToLoad();
56          selectWindow("null");
57          waitAndClick("xpath=(//input[@name='imageField'])[2]");
58      }
59  
60      @Ignore // link to create new is off the main menu
61      @Test
62      public void testLookUp() throws Exception {}
63  
64      @Override
65      public void lookupAssertions() {
66          //none yet
67      }
68  }