001/**
002 * Copyright 2005-2016 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.krad.screenelement;
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 IncidentReportAft extends WebDriverLegacyITBase {
027
028    /**
029     * /kr-krad/uitest?viewId=Travel-testView2&methodToCall=foo
030     */
031    public static final String BOOKMARK_URL ="/kr-krad/uitest?viewId=Travel-testView2&methodToCall=foo";
032
033    @Override
034    protected String getBookmarkUrl() {
035        return BOOKMARK_URL;
036    }
037
038    @Override
039    protected void navigate() throws InterruptedException {
040        waitAndClickKRAD();
041        waitAndClickByLinkText("Incident Report");
042        switchToWindow("Kuali :: Incident Report");
043    }
044    
045    private void testIncidentReport() throws Exception{
046        waitForTextPresent("Incident Report");
047        waitForTextPresent("Incident Feedback");
048        waitForTextPresent("The system has encountered an error and is unable to complete your request at this time. Please provide more information regarding this error by completing this Incident Report.");
049        waitForTextPresent("Stacktrace (only in dev mode)");
050        waitForElementPresentByXpath("//button[contains(text(),'Submit Report')]");
051    }
052    
053    @Test
054    public void testIncidentReportBookmark() throws Exception {
055        testIncidentReport();
056        passed();
057    }
058
059    @Test
060    public void testIncidentReportNav() throws Exception {
061        testIncidentReport();
062        passed();
063    }
064    
065}