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;
017
018import org.kuali.rice.testtools.common.JiraAwareFailable;
019import org.kuali.rice.testtools.selenium.AutomatedFunctionalTestUtils;
020import org.kuali.rice.testtools.selenium.WebDriverUtils;
021
022/**
023 * @author Kuali Rice Team (rice.collab@kuali.org)
024 */
025public abstract class ClearAllCashesAftBase extends AdminTmplMthdAftNavBase {
026
027    /**
028     * ITUtil.PORTAL+"?channelTitle=Cache%20Admin&channelUrl="+WebDriverUtils.getBaseUrlString()+
029     * "/kr-krad/core/admin/cache?viewId=CacheAdmin-view1&methodToCall=start"+    
030     */
031    public static final String BOOKMARK_URL = AutomatedFunctionalTestUtils.PORTAL+"?channelTitle=Cache%20Admin&channelUrl="+ WebDriverUtils
032            .getBaseUrlString()+"/kr-krad/core/admin/cache?viewId=CacheAdmin-view1&methodToCall=start";
033
034    @Override
035    protected String getBookmarkUrl() {
036        return BOOKMARK_URL;
037    }
038
039    /**
040     * {@inheritDoc}
041     * Cache Admin
042     * @return
043     */
044    @Override
045    protected String getLinkLocator() {
046        return "Cache Admin";
047    }
048
049    public void testClearAllCashesBookmark(JiraAwareFailable failable) throws Exception {
050        testClearAllCashes();
051        passed();
052    }
053
054    public void testClearAllCashesNav(JiraAwareFailable failable) throws Exception {
055        testClearAllCashes();
056        passed();
057    }    
058    
059    public void testClearAllCashes() throws Exception
060    {
061        selectFrameIframePortlet();
062        assertTextPresent(new String[] {"coreServiceDistributedCacheManager", "kewDistributedCacheManager",
063            "kimDistributedCacheManager", "krmsDistributedCacheManager", "locationDistributedCacheManager"});
064        waitAndClickButtonByText("Flush");
065//        assertTextPresent("All caches were flushed for the CacheManager: coreServiceDistributedCacheManager."); // displays to fast to assert
066        waitForTextPresent("Cache Management");
067    }
068}