1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.samplu.krad.demo.uif.library.navigation;
17
18 import com.thoughtworks.selenium.SeleneseTestBase;
19 import edu.samplu.common.Failable;
20 import edu.samplu.common.ITUtil;
21 import edu.samplu.common.WebDriverLegacyITBase;
22 import edu.samplu.krad.demo.uif.library.DemoLibraryITBase;
23
24
25
26
27 public abstract class DemoLibraryNavigationSmokeTestBase extends DemoLibraryITBase {
28
29
30
31
32 public static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=Demo-NavigationGroup-View";
33
34
35
36
37 public static final String BOOKMARK_VIEW_URL = "/kr-krad/kradsampleapp?viewId=NavigationGroup-NavigationView&methodToCall=start";
38
39 @Override
40 public String getTestUrl() {
41 return ITUtil.KRAD_PORTAL;
42 }
43
44 protected void testNavigationTabs() throws Exception {
45 navigateToExample("Demo-NavigationGroup-Example1");
46
47 waitAndClickByLinkText("Navigation Group Tab Example");
48 selectWindow(driver.getWindowHandles().toArray()[1].toString());
49 waitForElementPresentByClassName("uif-headerText-span");
50 SeleneseTestBase.assertTrue(driver.getTitle().contains("Kuali :: Navigation View"));
51 assertTextPresent("Navigation View");
52 }
53
54 protected void testNavigationView() throws Exception {
55 assertNavigationView("Page 2", "Test Course 2");
56 assertNavigationView("Page 3", "Test Course 3");
57 assertNavigationView("Page 1", "Test Course 1");
58 }
59
60 protected void assertNavigationView(String linkText, String supportTitleText) throws Exception {
61 waitAndClickByLinkText(linkText);
62 waitForElementPresentByClassName("uif-viewHeader-supportTitle");
63 SeleneseTestBase.assertTrue(getTextByClassName("uif-viewHeader-supportTitle").contains(supportTitleText));
64 }
65
66 public void testNavigationMenuBookmark(Failable failable) throws Exception {
67 testNavigationTabs();
68 testNavigationView();
69 passed();
70 }
71
72 public void testNavigationMenuNav(Failable failable) throws Exception {
73 navigateToLibraryDemo("Navigation", "Navigation Group");
74 testNavigationTabs();
75 testNavigationView();
76 passed();
77 }
78
79 public void testNavigationViewBookmark(Failable failable) throws Exception {
80 testNavigationView();
81 passed();
82 }
83 }