1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.samplu.krad.library.elements;
17
18 import org.junit.Test;
19
20 import org.kuali.rice.testtools.selenium.Failable;
21 import org.kuali.rice.testtools.selenium.ITUtil;
22 import org.kuali.rice.testtools.selenium.SmokeTestBase;
23 import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
24
25
26
27
28 public class DemoLibraryElementsHeaderSmokeTest extends SmokeTestBase {
29
30
31
32
33 public static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=Demo-Header-View&methodToCall=start";
34
35 @Override
36 protected String getBookmarkUrl() {
37 return BOOKMARK_URL;
38 }
39
40 @Override
41 protected void navigate() throws Exception {
42 waitAndClickById("Demo-LibraryLink", "");
43 waitAndClickByLinkText("Elements");
44 waitAndClickByLinkText("Header");
45 }
46
47 protected void testLibraryElementsHeaderBaseHeader() throws Exception {
48 assertElementPresentByXpath("//div[@data-header_for='Demo-Header-Example1']/h3/span");
49 }
50
51 protected void testLibraryElementsHeader1() throws Exception {
52 waitAndClickByLinkText("Header 1");
53 assertElementPresentByXpath("//h1/span");
54 }
55
56 protected void testLibraryElementsHeader2() throws Exception {
57 waitAndClickByLinkText("Header 2");
58 assertElementPresentByXpath("//div[@id='Demo-Header-Example3']/div[@class='uif-verticalBoxLayout clearfix']/div/div/h2/span");
59 }
60
61 protected void testLibraryElementsHeader3() throws Exception {
62 waitAndClickByLinkText("Header 3");
63 assertElementPresentByXpath("//div[@id='Demo-Header-Example4']/div[@class='uif-verticalBoxLayout clearfix']/div/div/h3/span");
64 }
65
66 protected void testLibraryElementsHeader4() throws Exception {
67 waitAndClickByLinkText("Header 4");
68 assertElementPresentByXpath("//div[@id='Demo-Header-Example5']/div[@class='uif-verticalBoxLayout clearfix']/div/div/h4/span");
69 }
70
71 protected void testLibraryElementsHeader5() throws Exception {
72 waitAndClickByLinkText("Header 5");
73 assertElementPresentByXpath("//div[@id='Demo-Header-Example6']/div[@class='uif-verticalBoxLayout clearfix']/div/div/h5/span");
74 }
75
76 protected void testLibraryElementsHeader6() throws Exception {
77 waitAndClickByLinkText("Header 6");
78 assertElementPresentByXpath("//div[@id='Demo-Header-Example7']/div[@class='uif-verticalBoxLayout clearfix']/div/div/h6/span");
79 }
80
81 protected void testLibraryElementsHeaderEditableHeader() throws Exception {
82 waitAndClickByLinkText("EditablePage Header");
83 assertElementPresentByXpath("//div[@id='Demo-Header-Example12']/div[@class='uif-verticalBoxLayout clearfix']/div/div[@class='uif-pageHeader clearfix uif-boxLayoutVerticalItem clearfix']/h2/span");
84 assertElementPresentByXpath("//div[@id='Demo-Header-Example12']/div[@class='uif-verticalBoxLayout clearfix']/div/div[@class='uif-verticalBoxGroup uif-header-lowerGroup']/div[@class='uif-verticalBoxLayout clearfix']/div[1]/div/button[@class='btn btn-small uif-expandDisclosuresButton uif-boxLayoutHorizontalItem']");
85 assertElementPresentByXpath("//div[@id='Demo-Header-Example12']/div[@class='uif-verticalBoxLayout clearfix']/div/div[@class='uif-verticalBoxGroup uif-header-lowerGroup']/div[@class='uif-verticalBoxLayout clearfix']/div[1]/div/button[@class='btn btn-small uif-collapseDisclosuresButton uif-boxLayoutHorizontalItem']");
86 assertElementPresentByXpath("//div[@id='Demo-Header-Example12']/div[@class='uif-verticalBoxLayout clearfix']/div/div[@class='uif-verticalBoxGroup uif-header-lowerGroup']/div[@class='uif-verticalBoxLayout clearfix']/div[2]/div/span[@class='uif-requiredInstructionsMessage uif-boxLayoutHorizontalItem']");
87 }
88
89 protected void testLibraryElementsHeaderReadOnlyPageHeader() throws Exception {
90 waitAndClickByLinkText("Disclosure Header");
91 assertElementPresentByXpath("//div[@id='Demo-Header-Example13']/div[@class='uif-verticalBoxLayout clearfix']/div/div[@class='uif-pageHeader clearfix uif-boxLayoutVerticalItem clearfix']/h2/span");
92 }
93
94 protected void testLibraryElementsHeaderImageCaptionHeader() throws Exception {
95 waitAndClickByLinkText("ImageCaption Header");
96 assertElementPresentByXpath("//div[@id='Demo-Header-Example14']/div[@class='uif-verticalBoxLayout clearfix']/div/div[@class='uif-pageHeader clearfix uif-boxLayoutVerticalItem clearfix']/h2/span");
97 }
98
99 protected void testLibraryElementsHeaderGroupsHeader() throws Exception {
100 waitAndClickByLinkText("Header Groups");
101 assertElementPresentByXpath("//div[@id='Demo-Header-Example15']/div[@class='uif-verticalBoxLayout clearfix']/div/div[@class='uif-pageHeader clearfix uif-boxLayoutVerticalItem clearfix']/h2/span");
102 }
103
104 @Test
105 public void testElementsHeaderBookmark() throws Exception {
106 testLibraryElementsHeaderBaseHeader();
107 testLibraryElementsHeader1();
108 testLibraryElementsHeader2();
109 testLibraryElementsHeader3();
110 testLibraryElementsHeader4();
111 testLibraryElementsHeader5();
112 testLibraryElementsHeader6();
113 testLibraryElementsHeaderEditableHeader();
114 testLibraryElementsHeaderReadOnlyPageHeader();
115 passed();
116 }
117
118 @Test
119 public void testElementsHeaderNav() throws Exception {
120 testLibraryElementsHeaderBaseHeader();
121 testLibraryElementsHeader1();
122 testLibraryElementsHeader2();
123 testLibraryElementsHeader3();
124 testLibraryElementsHeader4();
125 testLibraryElementsHeader5();
126 testLibraryElementsHeader6();
127 testLibraryElementsHeaderEditableHeader();
128 testLibraryElementsHeaderReadOnlyPageHeader();
129 passed();
130 }
131 }