1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.samplu.krad.library.layoutmanagers;
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 DemoLibraryLayoutManagersCssGridLayoutSmokeTest extends SmokeTestBase {
29
30
31
32
33 public static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=Demo-CssGridLayoutManager-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("Layout Managers");
44 waitAndClickByLinkText("Css Grid Layout");
45 }
46
47 protected void testLayoutManagersCssGridLayoutDefault() throws Exception {
48 waitForElementPresentByXpath("//div[@id='Demo-CssGridLayoutManager-Example1']/div[@class='uif-verticalBoxLayout clearfix']/div/div[@class='uif-cssGridLayout']/div/div/div/input");
49 assertElementPresentByXpath("//div[@id='Demo-CssGridLayoutManager-Example1']/div[@class='uif-verticalBoxLayout clearfix']/div/div[@class='uif-cssGridLayout']/div/div[2]/div/input");
50 assertElementPresentByXpath("//div[@id='Demo-CssGridLayoutManager-Example1']/div[@class='uif-verticalBoxLayout clearfix']/div/div[@class='uif-cssGridLayout']/div/div[3]/div/input");
51 assertElementPresentByXpath("//div[@id='Demo-CssGridLayoutManager-Example1']/div[@class='uif-verticalBoxLayout clearfix']/div/div[@class='uif-cssGridLayout']/div[2]/div/div/input");
52 assertElementPresentByXpath("//div[@id='Demo-CssGridLayoutManager-Example1']/div[@class='uif-verticalBoxLayout clearfix']/div/div[@class='uif-cssGridLayout']/div[2]/div[2]/div/input");
53 }
54
55 protected void testLayoutManagersCssGridLayoutDefaultWidthBehaviour() throws Exception {
56 selectByName("exampleShown", "Default width behavior");
57 waitForElementPresentByXpath("//div[@id='Demo-CssGridLayoutManager-Example2']/div[@class='uif-verticalBoxLayout clearfix']/div/div/div/div/div/input");
58 assertElementPresentByXpath("//div[@id='Demo-CssGridLayoutManager-Example2']/div[@class='uif-verticalBoxLayout clearfix']/div/div/div[2]/div/div/input");
59 assertElementPresentByXpath("//div[@id='Demo-CssGridLayoutManager-Example2']/div[@class='uif-verticalBoxLayout clearfix']/div/div/div[2]/div[2]/div/input");
60 }
61
62 protected void testLayoutManagersCssGridLayoutRowCss() throws Exception {
63 selectByName("exampleShown", "Row Css");
64 waitForElementPresentByXpath("//div[@class='row demo-odd demo-border']/div/div/input[@name='inputField17']");
65 assertElementPresentByXpath("//div[@class='row demo-odd demo-border']/div/div/input[@name='inputField18']");
66 assertElementPresentByXpath("//div[@class='row demo-odd demo-border']/div/div/input[@name='inputField19']");
67 assertElementPresentByXpath("//div[@class='row demo-even demo-border']/div/div/input[@name='inputField20']");
68 assertElementPresentByXpath("//div[@class='row demo-even demo-border']/div/div/input[@name='inputField21']");
69 }
70
71 protected void testLayoutManagersCssGridLayoutDefaultColspan() throws Exception {
72 selectByName("exampleShown", "Default ColSpan");
73 waitForElementPresentByXpath("//div[@id='Demo-CssGridLayoutManager-Example6']/div[@class='uif-verticalBoxLayout clearfix']/div/div/div/div/div/input[@name='inputField22']");
74 assertElementPresentByXpath("//div[@id='Demo-CssGridLayoutManager-Example6']/div[@class='uif-verticalBoxLayout clearfix']/div/div/div/div/div/input[@name='inputField23']");
75 assertElementPresentByXpath("//div[@id='Demo-CssGridLayoutManager-Example6']/div[@class='uif-verticalBoxLayout clearfix']/div/div/div/div/div/input[@name='inputField24']");
76 assertElementPresentByXpath("//div[@id='Demo-CssGridLayoutManager-Example6']/div[@class='uif-verticalBoxLayout clearfix']/div/div/div/div/div/input[@name='inputField25']");
77 assertElementPresentByXpath("//div[@id='Demo-CssGridLayoutManager-Example6']/div[@class='uif-verticalBoxLayout clearfix']/div/div/div/div/div/input[@name='inputField26']");
78 }
79
80 protected void testLayoutManagersCssGridLayoutGroupLayout() throws Exception {
81 selectByName("exampleShown", "Group Layout");
82 waitForElementPresentByXpath("//div[@id='Demo-CssGridLayoutManager-Example7']/div[@class='uif-verticalBoxLayout clearfix']/div/div[@class='uif-cssGridLayout']/div/div/div[@class='uif-boxSection' and @style='background-color: #00CC66; height: 200px;']");
83 assertElementPresentByXpath("//div[@id='Demo-CssGridLayoutManager-Example7']/div[@class='uif-verticalBoxLayout clearfix']/div/div[@class='uif-cssGridLayout']/div/div/div[@class='uif-boxSection' and @style='background-color: #00CCFF; height: 200px;']");
84 }
85
86 @Test
87 public void testLayoutManagersCssGridLayoutBookmark() throws Exception {
88 testLayoutManagersCssGridLayoutDefault();
89 testLayoutManagersCssGridLayoutDefaultWidthBehaviour();
90 testLayoutManagersCssGridLayoutRowCss();
91 testLayoutManagersCssGridLayoutDefaultColspan();
92 testLayoutManagersCssGridLayoutGroupLayout();
93 passed();
94 }
95
96 @Test
97 public void testLayoutManagersCssGridLayoutNav() throws Exception {
98 testLayoutManagersCssGridLayoutDefault();
99 testLayoutManagersCssGridLayoutDefaultWidthBehaviour();
100 testLayoutManagersCssGridLayoutRowCss();
101 testLayoutManagersCssGridLayoutDefaultColspan();
102 testLayoutManagersCssGridLayoutGroupLayout();
103 passed();
104 }
105 }