View Javadoc
1   /**
2    * Copyright 2005-2015 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/ecl2.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.sampleu.main;
17  
18  import org.kuali.rice.testtools.selenium.AutomatedFunctionalTestUtils;
19  import org.kuali.rice.testtools.selenium.WebDriverUtils;
20  
21  /**
22   * @author Kuali Rice Team (rice.collab@kuali.org)
23   */
24  public class CreateNewAgendaAftBase extends MainTmplMthdSTNavBase{
25  
26      /**
27       * ITUtil.PORTAL + "?channelTitle=Create%20New%20Agenda&channelUrl=" + WebDriverUtils.getBaseUrlString() +
28       *  "/kr-krad/krmsAgendaEditor?methodToCall=start&dataObjectClassName=org.kuali.rice.krms.impl.ui.AgendaEditor&returnLocation=" +
29       *  ITUtil.PORTAL_URL + ITUtil.HIDE_RETURN_LINK;
30       */
31      public static final String BOOKMARK_URL = AutomatedFunctionalTestUtils.PORTAL + "?channelTitle=Create%20New%20Agenda&channelUrl=" + WebDriverUtils
32              .getBaseUrlString() +"/kr-krad/krmsAgendaEditor?methodToCall=start&dataObjectClassName=org.kuali.rice.krms.impl.ui.AgendaEditor&returnLocation=" +
33              AutomatedFunctionalTestUtils.PORTAL_URL + AutomatedFunctionalTestUtils.HIDE_RETURN_LINK;
34  
35      @Override
36      protected String getBookmarkUrl() {
37          return BOOKMARK_URL;
38      }
39  
40      /**
41       * {@inheritDoc}
42       * Create New Agenda
43       * @return
44       */
45      @Override
46      protected String getLinkLocator() {
47          return "Create New Agenda";
48      }
49  
50      protected void testCreateNewAgenda() throws Exception {
51          selectFrameIframePortlet();
52          String desc = getDescriptionUnique();
53          String docId = waitForAgendaDocId();
54          waitAndSelectLabeled("Namespace:", "Kuali Rules Test");
55          waitAndTypeLabeledInput("Name:", desc);
56          fireEvent("document.newMaintainableObject.dataObject.contextName", "focus");
57          waitAndTypeLabeledInput("Context:", "Context1");
58          fireEvent("document.newMaintainableObject.dataObject.contextName", "blur");
59          Thread.sleep(1000);
60          // extra focus and blur to work around KULRICE-11534 Create New Agenda requires two blur events to fully render Type when Context is typed in (first renders label, second renders select)
61          fireEvent("document.newMaintainableObject.dataObject.contextName", "focus");
62          Thread.sleep(500);
63          fireEvent("document.newMaintainableObject.dataObject.contextName", "blur");
64          waitForElementPresentByName("document.newMaintainableObject.dataObject.agenda.typeId");
65          waitAndSelectLabeled("Type:", "Campus Agenda");
66          waitForElementPresentByName("document.newMaintainableObject.dataObject.customAttributesMap[Campus]");
67          waitAndTypeLabeledInput("Campus:", "BL");
68          waitAndTypeLabeledInput("label:", "Type label for " + desc);
69          submitSuccessfully();
70          assertDocSearch(docId, "FINAL");
71      }
72  }