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.general; 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 DemoLibraryGeneralFeaturesStickyFooterSmokeTest extends SmokeTestBase { 026 027 /** 028 * /kr-krad/kradsampleapp?viewId=Demo-StickyFooter-View&methodToCall=start 029 */ 030 public static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=Demo-StickyFooter-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("General Features"); 041 waitAndClickByLinkText("Sticky Footer Options"); 042 } 043 044 protected void testGeneralFeaturesExample1() throws Exception { 045 waitAndClickByLinkText("Sticky Application Footer"); 046 waitAndClickByLinkText("Sticky application footer"); 047 switchToWindow("Kuali :: View Header"); 048 assertElementPresentByXpath("//div[@id='Uif-ApplicationFooter-Wrapper' and @data-sticky_footer='true']"); 049 switchToWindow("Kuali"); 050 } 051 052 protected void testGeneralFeaturesExample2() throws Exception { 053 waitAndClickByLinkText("Sticky Page Footer"); 054 waitAndClickByLinkText("Sticky page footer"); 055 switchToWindow("Kuali :: View Header"); 056 assertElementPresentByXpath("//div[@class='uif-horizontalBoxGroup uif-stickyFooter uif-stickyButtonFooter' and @data-sticky_footer='true']"); 057 switchToWindow("Kuali"); 058 } 059 060 protected void testGeneralFeaturesExample3() throws Exception { 061 waitAndClickByLinkText("Sticky View Footer"); 062 waitAndClickByLinkText("Sticky view footer"); 063 switchToWindow("Kuali :: View Header"); 064 assertElementPresentByXpath("//div[@class='uif-horizontalBoxGroup uif-stickyFooter uif-stickyButtonFooter' and @data-sticky_footer='true']"); 065 switchToWindow("Kuali"); 066 } 067 068 protected void testGeneralFeaturesExample4() throws Exception { 069 waitAndClickByLinkText("Sticky View Footer and Page Footer"); 070 waitAndClickByLinkText("Sticky page and view footer"); 071 switchToWindow("Kuali :: View Header"); 072 assertElementPresentByXpath("//div[@class='uif-horizontalBoxGroup uif-stickyFooter uif-stickyButtonFooter' and @data-sticky_footer='true']"); 073 switchToWindow("Kuali"); 074 } 075 076 protected void testGeneralFeaturesExample5() throws Exception { 077 waitAndClickByLinkText("Sticky Everything"); 078 waitAndClickByLinkText("All footer content sticky"); 079 switchToWindow("Kuali :: View Header"); 080 assertElementPresentByXpath("//div[@class='uif-horizontalBoxGroup uif-stickyFooter uif-stickyButtonFooter' and @data-sticky_footer='true']"); 081 assertElementPresentByXpath("//div[@id='Uif-ApplicationFooter-Wrapper' and @data-sticky_footer='true']"); 082 switchToWindow("Kuali"); 083 } 084 085 @Test 086 public void testGeneralFeaturesUnifiedViewHeaderBookmark() throws Exception { 087 testGeneralFeaturesExample5(); 088 testGeneralFeaturesExample4(); 089 testGeneralFeaturesExample3(); 090 testGeneralFeaturesExample2(); 091 testGeneralFeaturesExample1(); 092 passed(); 093 } 094 095 @Test 096 public void testGeneralFeaturesUnifiedViewHeaderNav() throws Exception { 097 testGeneralFeaturesExample5(); 098 testGeneralFeaturesExample4(); 099 testGeneralFeaturesExample3(); 100 testGeneralFeaturesExample2(); 101 testGeneralFeaturesExample1(); 102 passed(); 103 } 104 }