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     */
016    package edu.sampleu.krad.screenelement;
017    
018    import org.junit.Test;
019    import org.kuali.rice.testtools.selenium.AutomatedFunctionalTestUtils;
020    import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
021    import org.kuali.rice.testtools.selenium.WebDriverUtils;
022    
023    /**
024     * @author Kuali Rice Team (rice.collab@kuali.org)
025     */
026    public 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            waitAndClickByXpath("//a[@id='Demo-RowDetails-Section6_detLink_line0']");
047            waitForElementPresentByXpath("//input[@name='field4']");
048            waitAndClickByXpath("//a[@id='Demo-RowDetails-Section1_detLink_line0']");
049            waitForElementPresentByXpath("//input[@name='list2[0].field4']");
050            waitAndClickByXpath("//a[@id='Demo-RowDetails-Section2_detLink_line0']");
051            waitForElementPresentByXpath("//tr/td/div/div[@data-label='Field 3']");      
052            waitAndClickByXpath("//a[@id='Demo-RowDetails-Section3_detLink_line0']");
053            waitForTextPresent("SubField 2");
054            waitAndClickByXpath("//a[@id='Demo-RowDetails-Section4_detLink_line0']");
055            waitForTextPresent("SubCollection Title");
056            waitAndClickByXpath("//a[@id='Demo-RowDetails-Section5_detLink_line0']");
057            waitForTextPresent("SubCollection");
058            waitAndClickByXpath("//a[@id='Demo-RowDetails-Section7_detLink_line0']");
059            waitForElementPresentByXpath("//table[@class='uif-lightTable']");
060        }
061        
062        @Test
063        public void testRowDetailsBookmark() throws Exception {
064            testRowDetails();
065            passed();
066        }
067    
068        @Test
069        public void testRowDetailsNav() throws Exception {
070            testRowDetails();
071            passed();
072        }
073        
074    }