001    /**
002     * Copyright 2005-2013 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.samplu.krad.library.collections;
017    
018    import org.junit.Test;
019    
020    import org.kuali.rice.testtools.selenium.SmokeTestBase;
021    
022    /**
023     * @author Kuali Rice Team (rice.collab@kuali.org)
024     */
025    public class DemoLibraryCollectionFeaturesLightTableSmokeTest extends SmokeTestBase {
026    
027        /**
028         * /kr-krad/kradsampleapp?viewId=Demo-LightTable-View&methodToCall=start
029         */
030        public static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=Demo-LightTable-View&methodToCall=start";
031    
032        @Override
033        protected String getBookmarkUrl() {
034            return BOOKMARK_URL;
035        }
036    
037        @Override
038        protected void navigate() throws Exception {
039            waitAndClickById("Demo-LibraryLink", "");
040            waitAndClickByLinkText("Collection Features");
041            waitAndClickByLinkText("Light Table");
042        }
043    
044        protected void testCollectionFeaturesLightTableBasicData() throws Exception {
045            waitAndClickByLinkText("Basic Data");
046            waitAndClickByLinkText("Basic DataFields LightTable");
047            switchToWindow("Kuali :: Light Table test");
048            waitForElementPresentByXpath("//table[@id='Demo-LightTableGroup1_lightTable']/thead/tr/th[@aria-sort='ascending']");
049            switchToWindow("Kuali");
050        }
051        
052        protected void testCollectionFeaturesLightTableInquiryLinkActions() throws Exception {
053            waitAndClickByLinkText("Inquiry, Links, and Actions");
054            waitAndClickByXpath("//div[@id='Demo-LightTable-Example2']/div[@class='uif-verticalBoxLayout clearfix']/a");
055            switchToWindow("Kuali :: Light Table test");
056            switchToWindow("Kuali :: Light Table test");
057            waitForElementPresentByXpath("//table[@id='Demo-LightTableGroup2_lightTable']/tbody/tr/td/div/span/a");
058            assertElementPresentByXpath("//table[@id='Demo-LightTableGroup2_lightTable']/tbody/tr/td[5]/div/fieldset/div/div/button");
059            switchToWindow("Kuali");
060         }
061        
062        protected void testCollectionFeaturesLightTableConditionalRender() throws Exception {
063            waitAndClickByLinkText("Conditional Render");
064            waitAndClickByXpath("//div[@id='Demo-LightTable-Example3']/div[@class='uif-verticalBoxLayout clearfix']/a");
065            switchToWindow("Kuali :: Light Table test");
066            waitForElementPresentByXpath("//table[@id='Demo-LightTableGroup3_lightTable']/tbody/tr/td[3]");
067            switchToWindow("Kuali");
068        }
069        
070        protected void testCollectionFeaturesLightTableBasicInput() throws Exception {
071            waitAndClickByLinkText("Basic Input");
072            waitAndClickByLinkText("Basic Inputs");
073            switchToWindow("Kuali :: Light Table test");
074            waitForElementPresentByXpath("//table[@id='Demo-LightTableGroup4_lightTable']/tbody/tr/td/div/input");
075            assertElementPresentByXpath("//table[@id='Demo-LightTableGroup4_lightTable']/tbody/tr/td[3]/div/input[@type='checkbox']");
076            assertElementPresentByXpath("//table[@id='Demo-LightTableGroup4_lightTable']/tbody/tr/td[4]/div/select");
077            switchToWindow("Kuali");
078        }
079        
080        @Test
081        public void testCollectionFeaturesLightTableBasicDataBookmark() throws Exception {
082            testCollectionFeaturesLightTableBasicData();
083            passed();
084        }
085        
086        @Test
087        public void testCollectionFeaturesLightTableInquiryLinkActionsBookmark() throws Exception {
088            testCollectionFeaturesLightTableInquiryLinkActions();
089            passed();
090        }
091    
092        @Test
093        public void testCollectionFeaturesLightTableConditionalRenderBookmark() throws Exception {
094            testCollectionFeaturesLightTableConditionalRender();
095            passed();
096        }
097        
098        @Test
099        public void testCollectionFeaturesLightTableBasicInputBookmark() throws Exception {
100            testCollectionFeaturesLightTableBasicInput();
101            passed();
102        }
103    
104        @Test
105        public void testCollectionFeaturesLightTableBasicDataNav() throws Exception {
106            testCollectionFeaturesLightTableBasicData();
107            passed();
108        }
109        
110        @Test
111        public void testCollectionFeaturesLightTableInquiryLinkActionsNav() throws Exception {
112            testCollectionFeaturesLightTableInquiryLinkActions();
113            passed();
114        }
115    
116        @Test
117        public void testCollectionFeaturesLightTableConditionalRenderNav() throws Exception {
118            testCollectionFeaturesLightTableConditionalRender();
119            passed();
120        }
121        
122        @Test
123        public void testCollectionFeaturesLightTableBasicInputNav() throws Exception {
124            testCollectionFeaturesLightTableBasicInput();
125            passed();
126        }
127    }