View Javadoc

1   /**
2    * Copyright 2005-2013 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 edu.samplu.krad.demo.uif.library;
17  
18  import com.thoughtworks.selenium.SeleneseTestBase;
19  import edu.samplu.common.Failable;
20  import org.junit.Test;
21  
22  /**
23   * @author Kuali Rice Team (rice.collab@kuali.org)
24   */
25  public class DemoLibraryNavigationSmokeTest extends DemoLibraryNavigationBase {
26  
27      /**
28       * /kr-krad/kradsampleapp?viewId=ComponentLibraryHome
29       */
30      public static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=Demo-NavigationGroup-View";
31  
32      @Override
33      public String getBookmarkUrl() {
34          return BOOKMARK_URL;
35      }
36  
37      @Override
38      protected void navigate() throws Exception {
39          navigateToExample("Demo-NavigationGroup-Example1");
40      }
41  
42      protected void testNavigationTabs() throws Exception {
43          waitAndClickByLinkText("Navigation Group Tab Example");
44          try {
45              selectWindow(driver.getWindowHandles().toArray()[1].toString());
46          } catch (Throwable t) {
47              fail("Expected another window to be opened " + t.getCause());
48          }
49          waitForElementPresentByClassName("uif-headerText-span");
50          SeleneseTestBase.assertTrue(driver.getTitle().contains("Kuali :: Navigation View"));
51          assertTextPresent("Navigation View");
52      }
53  
54      public void testNavigationMenuBookmark(Failable failable) throws Exception {
55          testNavigationTabs();
56          testNavigationView();
57          passed();
58      }
59  
60      public void testNavigationMenuNav(Failable failable) throws Exception {
61          navigateToLibraryDemo("Navigation", "Navigation Group");
62          testNavigationTabs();
63          testNavigationView();
64          passed();
65      }
66  
67      @Test
68      public void testNavigationMenuBookmark() throws Exception {
69          testNavigationMenuBookmark(this);
70      }
71  
72      @Test
73      public void testNavigationMenuNav() throws Exception {
74          testNavigationMenuNav(this);
75      }
76  }