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