View Javadoc
1   /**
2    * Copyright 2005-2014 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.krad.demo.uif.library.general;
17  
18  import org.junit.Test;
19  import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
20  
21  /**
22   * @author Kuali Rice Team (rice.collab@kuali.org)
23   */
24  public class DemoGeneralFeaturesStickyHeaderAft extends WebDriverLegacyITBase {
25  
26      /**
27       * /kr-krad/kradsampleapp?viewId=Demo-StickyHeaderView&methodToCall=start
28       */
29      public static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=Demo-StickyHeaderView&methodToCall=start";
30  
31      @Override
32      protected String getBookmarkUrl() {
33          return BOOKMARK_URL;
34      }
35  
36      @Override
37      protected void navigate() throws Exception {
38          waitAndClickById("Demo-LibraryLink", "");
39          waitAndClickByLinkText("General Features");
40          waitAndClickByLinkText("Sticky Header Options");
41      }
42  
43      protected void testGeneralFeaturesExample1() throws Exception {
44          waitAndClickByLinkText("Sticky View Header");
45          waitAndClickByXpath("//section[@id='Demo-StickyHeader-Example1']/a");
46          switchToWindow("Kuali :: View Header");
47          waitForElementPresentByXpath("//header[@id='Uif-ApplicationHeader-Wrapper']");
48          switchToWindow("Kuali");
49      }
50      
51      protected void testGeneralFeaturesExample2() throws Exception {
52          waitAndClickByLinkText("Sticky Application Header and View Header");
53          waitAndClickByXpath("//section[@id='Demo-StickyHeader-Example2']/a");
54          switchToWindow("Kuali :: View Header");
55          waitForElementPresentByXpath("//header[@id='Uif-ApplicationHeader-Wrapper' and @data-sticky='true']");
56          switchToWindow("Kuali");
57      }
58      
59      protected void testGeneralFeaturesExample3() throws Exception {
60          waitAndClickByLinkText("Sticky Breadcrumbs, Application Header and View Header");
61          waitAndClickByXpath("//section[@id='Demo-StickyHeader-Example3']/a");
62          switchToWindow("Kuali :: View Header");
63          assertElementPresentByXpath("//header[@data-header_for='Demo-StickyHeaderFooter-View3' and @data-sticky='true']");
64          switchToWindow("Kuali");
65      }
66      
67      protected void testGeneralFeaturesExample4() throws Exception {
68          waitAndClickByLinkText("Sticky Application Header, Top Group and View Header");
69          waitAndClickByXpath("//section[@id='Demo-StickyHeader-Example4']/a");
70          switchToWindow("Kuali :: View Header");
71          assertElementPresentByXpath("//header[@data-header_for='Demo-StickyHeaderFooter-View4' and @data-sticky='true']");
72          switchToWindow("Kuali");
73      }
74      
75      protected void testGeneralFeaturesExample5() throws Exception {
76          waitAndClickByLinkText("Sticky Everything");
77          waitAndClickByLinkText("All header content sticky");
78          switchToWindow("Kuali :: View Header");
79          waitForElementPresentByXpath("//header[@id='Uif-ApplicationHeader-Wrapper' and @data-sticky='true']");
80          assertElementPresentByXpath("//header[@data-header_for='Demo-StickyHeaderFooter-View5' and @data-sticky='true']");
81          switchToWindow("Kuali");
82      }
83      
84      @Test
85      public void testGeneralFeaturesUnifiedViewHeader1Bookmark() throws Exception{
86      	testGeneralFeaturesExample1();
87          passed();
88      }
89      
90      @Test
91      public void testGeneralFeaturesUnifiedViewHeader1Nav() throws Exception{
92      	testGeneralFeaturesExample1();
93          passed();
94      }
95      
96      @Test
97      public void testGeneralFeaturesUnifiedViewHeader2Bookmark() throws Exception{
98      	testGeneralFeaturesExample2();
99          passed();
100     }
101     
102     @Test
103     public void testGeneralFeaturesUnifiedViewHeader2Nav() throws Exception{
104     	testGeneralFeaturesExample2();
105         passed();
106     }
107     
108     @Test
109     public void testGeneralFeaturesUnifiedViewHeader3Bookmark() throws Exception{
110     	testGeneralFeaturesExample3();
111         passed();
112     }
113     
114     @Test
115     public void testGeneralFeaturesUnifiedViewHeader3Nav() throws Exception{
116     	testGeneralFeaturesExample3();
117         passed();
118     }
119     
120     @Test
121     public void testGeneralFeaturesUnifiedViewHeader4Bookmark() throws Exception{
122     	testGeneralFeaturesExample4();
123         passed();
124     }
125     
126     @Test
127     public void testGeneralFeaturesUnifiedViewHeader4Nav() throws Exception{
128     	testGeneralFeaturesExample4();
129         passed();
130     }
131     
132     @Test
133     public void testGeneralFeaturesUnifiedViewHeader5Bookmark() throws Exception{
134     	testGeneralFeaturesExample5();
135         passed();
136     }
137     
138     @Test
139     public void testGeneralFeaturesUnifiedViewHeader5Nav() throws Exception{
140     	testGeneralFeaturesExample5();
141         passed();
142     }
143 }