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
23
24
25
26 public class DemoLibraryNavigationSmokeTestBase extends WebDriverLegacyITBase{
27
28
29
30
31 public static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=ComponentLibraryHome";
32
33
34
35
36 public static final String BOOKMARK_VIEW_URL = "/kr-krad/kradsampleapp?viewId=NavigationGroup-NavigationView&methodToCall=start";
37
38 @Override
39 public String getTestUrl() {
40 return ITUtil.KRAD_PORTAL;
41 }
42
43 protected void navigation() throws Exception {
44 waitAndClickById("Demo-LibraryLink", "");
45 }
46
47 protected void navigationMenu() throws Exception {
48 waitAndClickByLinkText("Navigation");
49 waitAndClickByLinkText("Left Menu");
50 waitAndClickByLinkText("Navigation Group Tab Example");
51 selectWindow(driver.getWindowHandles().toArray()[1].toString());
52 }
53
54 protected void testNavigationMenu() throws Exception {
55 waitForElementPresentByClassName("uif-headerText-span");
56 SeleneseTestBase.assertTrue(driver.getTitle().contains("Kuali :: Navigation View"));
57 assertTextPresent("Navigation View");
58 }
59
60 protected void testNavigationView() throws Exception {
61 assertNavigationView("Page 2", "Test Course 2");
62 assertNavigationView("Page 3", "Test Course 3");
63 assertNavigationView("Page 1", "Test Course 1");
64 }
65
66 protected void assertNavigationView(String linkText, String supportTitleText) throws Exception {
67 waitAndClickByLinkText(linkText);
68 waitForElementPresentByClassName("uif-viewHeader-supportTitle");
69 SeleneseTestBase.assertTrue(getTextByClassName("uif-viewHeader-supportTitle").contains(supportTitleText));
70 }
71
72 public void testNavigationMenuBookmark(Failable failable) throws Exception {
73 navigationMenu();
74 testNavigationMenu();
75 testNavigationView();
76 passed();
77 }
78
79 public void testNavigationMenuNav(Failable failable) throws Exception {
80 navigation();
81 navigationMenu();
82 testNavigationMenu();
83 testNavigationView();
84 passed();
85 }
86
87 public void testNavigationViewBookmark(Failable failable) throws Exception {
88 testNavigationView();
89 passed();
90 }
91 }