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.navigation;
17  
18  import org.junit.Test;
19  
20  import org.openqa.selenium.By;
21  
22  /**
23   * @author Kuali Rice Team (rice.collab@kuali.org)
24   */
25  public class DemoNavigationGroupAft extends DemoLibraryNavigationBase {
26  
27      /**
28       * /kr-krad/kradsampleapp?viewId=Demo-NavigationGroupView&methodToCall=start
29       */
30      public static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=Demo-NavigationGroupView&methodToCall=start";
31   
32      @Override
33      protected String getBookmarkUrl() {
34          return BOOKMARK_URL;
35      }
36  
37      @Override
38      protected void navigate() throws Exception {
39          waitAndClickById("Demo-LibraryLink", "");
40          waitAndClickByLinkText("Navigation");
41          waitAndClickByLinkText("Navigation Group");
42      }
43  
44      protected void testNavigationView() throws Exception {
45         waitAndClickByLinkText("Navigation Group Tab Example");
46         switchToWindow("Kuali :: Navigation View");
47         waitForElementPresentByXpath("//nav[@id='Uif-Navigation']/ul/li");
48         assertElementPresentByXpath("//nav[@id='Uif-Navigation']/ul/li[3]");
49         super.testNavigationView();
50         switchToWindow("Kuali");
51      }
52      
53      protected void testNavigationMenuView() throws Exception {
54          selectByName("exampleShown","Navigation Group Menu");
55          waitAndClickByLinkText("Navigation Group Menu Example");
56          switchToWindow("Kuali :: Navigation Menu View");
57          waitForElementPresentByXpath("//div[@class='uif-menuNavigationGroup']");
58          waitAndClick(By.className("icon-angle-left"));
59          waitForElementPresentByXpath("//div[@class='uif-menuNavigationGroup sidebar-collapsed']");
60          switchToWindow("Kuali");
61      }
62      
63      protected void testNavigationWithToggleMenu() throws Exception {
64          selectByName("exampleShown","With Toggle Menu");
65          waitAndClickByLinkText("Navigation Toggle Menu");
66          switchToWindow("Kuali :: Navigation Menu View");
67          waitAndClickByLinkText("Page 1");
68          waitAndClickByLinkText("Page 2");
69          waitAndClickByLinkText("More Content");
70          switchToWindow("Kuali");
71      }
72  
73      @Test
74      public void testNavigationViewBookmark() throws Exception {
75          testNavigationView();
76          passed();
77      }
78  
79      @Test
80      public void testNavigationViewNav() throws Exception {
81          testNavigationView();
82          passed();
83      }  
84      
85      @Test
86      public void testNavigationMenuViewBookmark() throws Exception {
87          testNavigationMenuView();
88          passed();
89      }
90  
91      @Test
92      public void testNavigationMenuViewNav() throws Exception {
93          testNavigationMenuView();
94          passed();
95      }  
96      
97      @Test
98      public void testNavigationToggleMenuBookmark() throws Exception {
99          testNavigationWithToggleMenu();
100         passed();
101     }
102 
103     @Test
104     public void testNavigationToggleMenuNav() throws Exception {
105         testNavigationWithToggleMenu();
106         passed();
107     }  
108 }