1
2
3
4
5
6
7
8
9
10
11
12
13
14
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
24
25 public class DemoLibraryNavigationSmokeTest extends DemoLibraryNavigationBase {
26
27
28
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 }