View Javadoc
1   /**
2    * Copyright 2005-2014 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.common.JiraAwareFailable;
19  import org.kuali.rice.testtools.selenium.AutomatedFunctionalTestUtils;
20  import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
21  import org.kuali.rice.testtools.selenium.WebDriverUtils;
22  import org.junit.Test;
23  
24  /**
25   * @author Kuali Rice Team (rice.collab@kuali.org)
26   */
27  public class CreateNewAgendaAft extends WebDriverLegacyITBase {
28  
29      /**
30       * ITUtil.PORTAL + "?channelTitle=Create%20New%20Agenda&channelUrl=" + WebDriverUtils.getBaseUrlString() +
31       *  "/kr-krad/krmsAgendaEditor?methodToCall=start&dataObjectClassName=org.kuali.rice.krms.impl.ui.AgendaEditor&returnLocation=" +
32       *  ITUtil.PORTAL_URL + ITUtil.HIDE_RETURN_LINK;
33       */
34      public static final String BOOKMARK_URL = AutomatedFunctionalTestUtils.PORTAL + "?channelTitle=Create%20New%20Agenda&channelUrl=" + WebDriverUtils
35              .getBaseUrlString() +"/kr-krad/krmsAgendaEditor?methodToCall=start&dataObjectClassName=org.kuali.rice.krms.impl.ui.AgendaEditor&returnLocation=" +
36              AutomatedFunctionalTestUtils.PORTAL_URL + AutomatedFunctionalTestUtils.HIDE_RETURN_LINK;
37  
38      @Override
39      protected String getBookmarkUrl() {
40          return BOOKMARK_URL;
41      }
42  
43      @Override
44      protected void navigate() throws Exception {
45          waitForTitleToEqualKualiPortalIndex();
46          selectTopFrame();
47          waitAndClickByLinkText("Main Menu","");
48          waitForTitleToEqualKualiPortalIndex();
49          waitAndClickByLinkText("Create New Agenda", "");
50          waitForTitleToEqualKualiPortalIndex("");
51          selectFrameIframePortlet();
52          checkForIncidentReport("Create New Agenda", "");
53      }
54  
55      //    @Override
56      //    protected String getBookmarkUrl() {
57      //        return BOOKMARK_URL;
58      //    }
59      //
60      //    /**
61      //     * {@inheritDoc}
62      //     * Create New Agenda
63      //     * @return
64      //     */
65      //    @Override
66      //    protected String getLinkLocator() {
67      //        return "Create New Agenda";
68      //    }
69  
70  
71      protected void createNewEnterDetails() throws InterruptedException {
72          selectFrameIframePortlet();
73          selectByName("document.newMaintainableObject.dataObject.namespace","Kuali Rules Test");
74          waitAndTypeByName("document.newMaintainableObject.dataObject.agenda.name",getDescriptionUnique());
75          waitAndTypeByName("document.newMaintainableObject.dataObject.contextName","Context1");
76      }
77  
78      @Test
79      public void testCreateNewAgendaSaveBookmark() throws Exception {
80          createNewEnterDetails();
81          waitAndClickByXpath("//button[contains(text(),'Save')]");
82          passed();
83      }
84  
85      @Test
86      public void testCreateNewAgendaSaveNav() throws Exception {
87          createNewEnterDetails();
88          waitAndClickByXpath("//button[contains(text(),'Save')]");
89          passed();
90      }
91  
92      @Test
93      public void testCreateNewAgendaSubmitBookmark() throws Exception {
94          createNewEnterDetails();
95          waitAndClickByXpath("//button[contains(text(),'Submit')]");
96          waitAndClickConfirmationOk();
97          passed();
98      }
99  
100     @Test
101     public void testCreateNewAgendaSubmitNav() throws Exception {
102         createNewEnterDetails();
103         waitAndClickByXpath("//button[contains(text(),'Submit')]");
104         waitAndClickConfirmationOk();
105         passed();
106     }
107 
108     @Test
109     public void testCreateNewAgendaSaveSubmitBookmark() throws Exception {
110         createNewEnterDetails();
111         waitAndClickByXpath("//button[contains(text(),'Save')]");
112         waitAndClickByXpath("//button[contains(text(),'Submit')]");
113         waitAndClickConfirmationOk();
114         passed();
115     }
116 
117     @Test
118     public void testCreateNewAgendaSaveSubmitNav() throws Exception {
119         createNewEnterDetails();
120         waitAndClickByXpath("//button[contains(text(),'Save')]");
121         waitAndClickByXpath("//button[contains(text(),'Submit')]");
122         waitAndClickConfirmationOk();
123         passed();
124     }
125 
126     public void testCreateNewAgendaBookmark(JiraAwareFailable failable) throws Exception {
127         testCreateNewAgenda();
128         passed();
129     }
130     public void testCreateNewAgendaNav(JiraAwareFailable failable) throws Exception {
131         testCreateNewAgenda();
132         passed();
133     }
134 }