001/**
002 * Copyright 2005-2015 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.admin.notification;
017
018import org.junit.Test;
019import org.kuali.rice.testtools.selenium.AutomatedFunctionalTestUtils;
020import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
021import org.kuali.rice.testtools.selenium.WebDriverUtils;
022
023/**
024 * @author Kuali Rice Team (rice.collab@kuali.org)
025 */
026public class SendEventNotificationAft extends WebDriverLegacyITBase {
027
028    /**
029     * AutomatedFunctionalTestUtils.PORTAL + "?channelTitle=Send%20Event%20Notification&channelUrl=" + WebDriverUtils
030     *.getBaseUrlString() + "/ken/SendEventNotificationMessage.form";
031     */
032    public static final String BOOKMARK_URL =
033            AutomatedFunctionalTestUtils.PORTAL + "?channelTitle=Send%20Event%20Notification&channelUrl=" + WebDriverUtils
034                    .getBaseUrlString() + "/ken/SendEventNotificationMessage.form";
035
036    @Override
037    protected String getBookmarkUrl() {
038        return BOOKMARK_URL;
039    }
040
041    @Override
042    protected void navigate() throws InterruptedException {
043        waitAndClickAdministration();
044        waitAndClickByLinkText("Send Event Notification");
045    }
046    
047    private void testEventNotification() throws Exception{
048        selectFrameIframePortlet();
049        selectByName("channelName","Kuali Rice Channel (2 subscribers, 0 default recipients)");
050        selectByName("priorityName","Normal");
051        clearTextByName("sendDateTime");
052        clearTextByName("senderNames");
053        waitAndTypeByName("senderNames","admin,rice-team");
054        waitAndTypeByName("autoRemoveDateTime","01/16/2030 06:16 AM");
055        waitAndTypeByName("title","Test Title");
056        waitAndTypeByName("message","Test Message");
057        waitAndTypeByName("summary","Test Event Summary");
058        waitAndTypeByName("description","Test Event Description");
059        waitAndTypeByName("location","California");
060        clearTextByName("startDateTime");
061        waitAndTypeByName("startDateTime","01/16/2015 02:38 PM");
062        waitAndTypeByName("stopDateTime","02/16/2015 02:38 PM");
063        waitAndClickByName("submit");
064        waitForTextPresent("Notification(s) sent.");
065    }
066    
067    @Test
068    public void testEventNotificationBookmark() throws Exception {
069        testEventNotification();
070        passed();
071    }
072
073    @Test
074    public void testEventNotificationNav() throws Exception {
075        testEventNotification();
076        passed();
077    }
078    
079}