1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.samplu.krad.library.general;
17
18 import org.junit.Test;
19
20 import org.kuali.rice.testtools.selenium.SmokeTestBase;
21
22
23
24
25 public class DemoLibraryGeneralFeaturesStickyHeaderSmokeTest extends SmokeTestBase {
26
27
28
29
30 public static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=Demo-StickyHeader-View&methodToCall=start";
31
32 @Override
33 protected String getBookmarkUrl() {
34 return BOOKMARK_URL;
35 }
36
37 @Override
38 protected void navigate() throws Exception {
39 waitAndClickById("Demo-LibraryLink", "");
40 waitAndClickByLinkText("General Features");
41 waitAndClickByLinkText("Sticky Header Options");
42 }
43
44 protected void testGeneralFeaturesExample1() throws Exception {
45 waitAndClickByLinkText("Sticky View Header");
46 waitAndClickByLinkText("Sticky View header");
47 switchToWindow("Kuali :: View Header");
48 assertElementPresentByXpath("//div[@class='uif-viewHeader-contentWrapper uif-sticky' and @data-sticky='true']");
49 switchToWindow("Kuali");
50 }
51
52 protected void testGeneralFeaturesExample2() throws Exception {
53 waitAndClickByLinkText("Sticky Application Header and View Header");
54 waitAndClickByLinkText("Sticky application header and View header");
55 switchToWindow("Kuali :: View Header");
56 assertElementPresentByXpath("//div[@id='Uif-ApplicationHeader-Wrapper' and @data-sticky='true']");
57 assertElementPresentByXpath("//div[@class='uif-viewHeader-contentWrapper uif-sticky' and @data-sticky='true']");
58 switchToWindow("Kuali");
59 }
60
61 protected void testGeneralFeaturesExample3() throws Exception {
62 waitAndClickByLinkText("Sticky Breadcrumbs, Application Header and View Header");
63 waitAndClickByLinkText("Sticky application header, breadcrumbs, and View header");
64 switchToWindow("Kuali :: View Header");
65 assertElementPresentByXpath("//div[@id='Uif-BreadcrumbWrapper' and @data-sticky='true']");
66 switchToWindow("Kuali");
67 }
68
69 protected void testGeneralFeaturesExample4() throws Exception {
70 waitAndClickByLinkText("Sticky Application Header, Top Group and View Header");
71 waitAndClickByLinkText("Sticky application header, top group, and View header");
72 switchToWindow("Kuali :: View Header");
73 assertElementPresentByXpath("//div[@id='Uif-TopGroupWrapper' and @data-sticky='true']");
74 assertElementPresentByXpath("//div[@class='uif-viewHeader-contentWrapper uif-sticky' and @data-sticky='true']");
75 switchToWindow("Kuali");
76 }
77
78 protected void testGeneralFeaturesExample5() throws Exception {
79 waitAndClickByLinkText("Sticky Everything");
80 waitAndClickByLinkText("All header content sticky");
81 switchToWindow("Kuali :: View Header");
82 assertElementPresentByXpath("//div[@id='Uif-TopGroupWrapper' and @data-sticky='true']");
83 assertElementPresentByXpath("//div[@class='uif-viewHeader-contentWrapper uif-sticky' and @data-sticky='true']");
84 assertElementPresentByXpath("//div[@id='Uif-BreadcrumbWrapper' and @data-sticky='true']");
85 switchToWindow("Kuali");
86 }
87
88 @Test
89 public void testGeneralFeaturesUnifiedViewHeaderBookmark() throws Exception {
90 testGeneralFeaturesExample5();
91 testGeneralFeaturesExample4();
92 testGeneralFeaturesExample3();
93 testGeneralFeaturesExample2();
94 testGeneralFeaturesExample1();
95 passed();
96 }
97
98 @Test
99 public void testGeneralFeaturesUnifiedViewHeaderNav() throws Exception {
100 testGeneralFeaturesExample5();
101 testGeneralFeaturesExample4();
102 testGeneralFeaturesExample3();
103 testGeneralFeaturesExample2();
104 testGeneralFeaturesExample1();
105 passed();
106 }
107 }