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 org.kuali.rice.testtools.selenium.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          Thread.sleep(1000);
45          try {
46              selectWindow(driver.getWindowHandles().toArray()[1].toString());
47          } catch (Throwable t) {
48              fail("Expected another window to be opened " + t.getCause());
49          }
50          waitForElementPresentByClassName("uif-headerText-span");
51          SeleneseTestBase.assertTrue(driver.getTitle().contains("Kuali :: Navigation View"));
52          assertTextPresent("Navigation View");
53      }
54  
55      public void testNavigationMenuBookmark(Failable failable) throws Exception {
56          testNavigationTabs();
57          testNavigationView();
58          passed();
59      }
60  
61      public void testNavigationMenuNav(Failable failable) throws Exception {
62          navigateToLibraryDemo("Navigation", "Navigation Group");
63          testNavigationTabs();
64          testNavigationView();
65          passed();
66      }
67  
68      @Test
69      public void testNavigationMenuBookmark() throws Exception {
70          testNavigationMenuBookmark(this);
71      }
72  
73      @Test
74      public void testNavigationMenuNav() throws Exception {
75          testNavigationMenuNav(this);
76      }
77  }