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 RowDetailsAft extends WebDriverLegacyITBase {
027
028    /**
029     * /kr-krad/uicomponents?viewId=Demo-RowDetails&methodToCall=start
030     */
031    public static final String BOOKMARK_URL ="/kr-krad/uicomponents?viewId=Demo-RowDetails&methodToCall=start";
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("Row Details Demo");
042        switchToWindow("Kuali :: Row Details Demo");
043    }
044    
045    private void testRowDetails() throws Exception{
046        waitForProgressLoading();
047        waitAndClickByXpath("//a[@id='Demo-RowDetails-Section6_detLink_line0']");
048        waitForElementPresentByXpath("//input[@name='field4']");
049        waitAndClickByXpath("//a[@id='Demo-RowDetails-Section1_detLink_line0']");
050        waitForElementPresentByXpath("//input[@name='list2[0].field4']");
051        waitAndClickByXpath("//a[@id='Demo-RowDetails-Section2_detLink_line0']");
052        waitForElementPresentByXpath("//tr/td/div/div[@data-label='Field 3']");
053        jGrowl("Expand TableCollection inside the details itself SubCollection");
054        waitAndClickByXpath("//a[@id='Demo-RowDetails-Section3_detLink_line0']");
055        waitForTextPresent("SubField 2");
056        waitAndClickByXpath("//a[@id='Demo-RowDetails-Section4_detLink_line0']");
057        waitForTextPresent("SubCollection Title");
058        waitAndClickByXpath("//a[@id='Demo-RowDetails-Section5_detLink_line0']");
059        waitForTextPresent("SubCollection");
060        waitAndClickByXpath("//a[@id='Demo-RowDetails-Section7_detLink_line0']");
061        waitForElementPresentByXpath("//table[@class='uif-lightTable']");
062    }
063    
064    @Test
065    public void testRowDetailsBookmark() throws Exception {
066        testRowDetails();
067        passed();
068    }
069
070    @Test
071    public void testRowDetailsNav() throws Exception {
072        testRowDetails();
073        passed();
074    }
075    
076}