001/** 002 * Copyright 2005-2014 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/ecl2.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 */ 016package edu.sampleu.main; 017 018import org.kuali.rice.testtools.common.JiraAwareFailable; 019import org.kuali.rice.testtools.selenium.AutomatedFunctionalTestUtils; 020import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase; 021import org.kuali.rice.testtools.selenium.WebDriverUtils; 022import org.junit.Test; 023 024/** 025 * @author Kuali Rice Team (rice.collab@kuali.org) 026 */ 027public class CreateNewAgendaAft extends WebDriverLegacyITBase { 028 029 /** 030 * ITUtil.PORTAL + "?channelTitle=Create%20New%20Agenda&channelUrl=" + WebDriverUtils.getBaseUrlString() + 031 * "/kr-krad/krmsAgendaEditor?methodToCall=start&dataObjectClassName=org.kuali.rice.krms.impl.ui.AgendaEditor&returnLocation=" + 032 * ITUtil.PORTAL_URL + ITUtil.HIDE_RETURN_LINK; 033 */ 034 public static final String BOOKMARK_URL = AutomatedFunctionalTestUtils.PORTAL + "?channelTitle=Create%20New%20Agenda&channelUrl=" + WebDriverUtils 035 .getBaseUrlString() +"/kr-krad/krmsAgendaEditor?methodToCall=start&dataObjectClassName=org.kuali.rice.krms.impl.ui.AgendaEditor&returnLocation=" + 036 AutomatedFunctionalTestUtils.PORTAL_URL + AutomatedFunctionalTestUtils.HIDE_RETURN_LINK; 037 038 @Override 039 protected String getBookmarkUrl() { 040 return BOOKMARK_URL; 041 } 042 043 @Override 044 protected void navigate() throws Exception { 045 waitForTitleToEqualKualiPortalIndex(); 046 selectTopFrame(); 047 waitAndClickByLinkText("Main Menu",""); 048 waitForTitleToEqualKualiPortalIndex(); 049 waitAndClickByLinkText("Create New Agenda", ""); 050 waitForTitleToEqualKualiPortalIndex(""); 051 selectFrameIframePortlet(); 052 checkForIncidentReport("Create New Agenda", ""); 053 } 054 055 // @Override 056 // protected String getBookmarkUrl() { 057 // return BOOKMARK_URL; 058 // } 059 // 060 // /** 061 // * {@inheritDoc} 062 // * Create New Agenda 063 // * @return 064 // */ 065 // @Override 066 // protected String getLinkLocator() { 067 // return "Create New Agenda"; 068 // } 069 070 071 protected void createNewEnterDetails() throws InterruptedException { 072 selectFrameIframePortlet(); 073 selectByName("document.newMaintainableObject.dataObject.namespace","Kuali Rules Test"); 074 waitAndTypeByName("document.newMaintainableObject.dataObject.agenda.name",getDescriptionUnique()); 075 waitAndTypeByName("document.newMaintainableObject.dataObject.contextName","Context1"); 076 } 077 078 @Test 079 public void testCreateNewAgendaSaveBookmark() throws Exception { 080 createNewEnterDetails(); 081 waitAndClickByXpath("//button[contains(text(),'Save')]"); 082 passed(); 083 } 084 085 @Test 086 public void testCreateNewAgendaSaveNav() throws Exception { 087 createNewEnterDetails(); 088 waitAndClickByXpath("//button[contains(text(),'Save')]"); 089 passed(); 090 } 091 092 @Test 093 public void testCreateNewAgendaSubmitBookmark() throws Exception { 094 createNewEnterDetails(); 095 waitAndClickByXpath("//button[contains(text(),'Submit')]"); 096 waitAndClickConfirmationOk(); 097 passed(); 098 } 099 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}