1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.demo.uif.library.layoutmanagers;
17
18 import org.junit.Test;
19
20 import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
21
22
23
24
25 public class LibraryLayoutManagersGridLayoutAft extends WebDriverLegacyITBase {
26
27
28
29
30 public static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=Demo-GridLayoutManagerView&methodToCall=start";
31
32 @Override
33 protected String getBookmarkUrl() {
34 return BOOKMARK_URL;
35 }
36
37 @Override
38 protected void navigate() throws Exception {
39 waitAndClickLibraryLink();
40 waitAndClickByLinkText("Layout Managers");
41 waitAndClickByLinkText("Grid Layout");
42 }
43
44 protected void testLayoutManagersGridLayout() throws Exception {
45 assertElementPresentByXpath("//div[@data-parent='Demo-GridLayoutManager-Example1']/table/tbody/tr/th/label");
46 assertElementPresentByXpath("//div[@data-parent='Demo-GridLayoutManager-Example1']/table/tbody/tr/td/div/input");
47 assertElementPresentByXpath("//div[@data-parent='Demo-GridLayoutManager-Example1']/table/tbody/tr[2]/th/label");
48 assertElementPresentByXpath("//div[@data-parent='Demo-GridLayoutManager-Example1']/table/tbody/tr[2]/td/div/input");
49 assertElementPresentByXpath("//div[@data-parent='Demo-GridLayoutManager-Example1']/table/tbody/tr[3]/th/label");
50 assertElementPresentByXpath("//div[@data-parent='Demo-GridLayoutManager-Example1']/table/tbody/tr[3]/td/div/input");
51 }
52
53 protected void testLayoutManagersGridLayouMultipleColumns() throws Exception {
54 selectByName("exampleShown","# of Columns");
55 assertElementPresentByXpath("//div[@data-parent='Demo-GridLayoutManager-Example2']/table/tbody/tr/th/label");
56 assertElementPresentByXpath("//div[@data-parent='Demo-GridLayoutManager-Example2']/table/tbody/tr/td/div/input[@name='inputField4']");
57 assertElementPresentByXpath("//div[@data-parent='Demo-GridLayoutManager-Example2']/table/tbody/tr/th[2]/label");
58 assertElementPresentByXpath("//div[@data-parent='Demo-GridLayoutManager-Example2']/table/tbody/tr/td[2]/div/input[@name='inputField5']");
59 }
60
61 protected void testLayoutManagersGridLayoutColumnSpan() throws Exception {
62 selectByName("exampleShown","Column Span");
63 assertElementPresentByXpath("//div[@data-parent='Demo-GridLayoutManager-Example3']/table/tbody/tr/th[@colspan='2']/label");
64 assertElementPresentByXpath("//div[@data-parent='Demo-GridLayoutManager-Example3']/table/tbody/tr/td[@colspan='2']/div/input[@name='inputField8']");
65 assertElementPresentByXpath("//div[@data-parent='Demo-GridLayoutManager-Example3']/table/tbody/tr/th[@colspan='1']/label");
66 assertElementPresentByXpath("//div[@data-parent='Demo-GridLayoutManager-Example3']/table/tbody/tr/td[@colspan='1']/div/input[@name='inputField9']");
67 assertElementPresentByXpath("//div[@data-parent='Demo-GridLayoutManager-Example3']/table/tbody/tr/th[@colspan='1'][2]/label");
68 assertElementPresentByXpath("//div[@data-parent='Demo-GridLayoutManager-Example3']/table/tbody/tr/td[@colspan='1'][2]/div/input[@name='inputField10']");
69 }
70
71 protected void testLayoutManagersGridLayoutRenderTHColumn() throws Exception {
72 selectByName("exampleShown","Render TH Column");
73 assertElementPresentByXpath("//div[@data-parent='Demo-GridLayoutManager-Example4']/table/tbody/tr/td/label");
74 assertElementPresentByXpath("//div[@data-parent='Demo-GridLayoutManager-Example4']/table/tbody/tr/td/div/input[@name='inputField12']");
75 }
76
77 protected void testLayoutManagersGridLayoutRowSpan() throws Exception {
78 selectByName("exampleShown","Row Span");
79 assertElementPresentByXpath("//div[@data-parent='Demo-GridLayoutManager-Example5']/table/tbody/tr/td[@rowspan='2']");
80 assertElementPresentByXpath("//div[@data-parent='Demo-GridLayoutManager-Example5']/table/tbody/tr/td[@rowspan='1']");
81 assertElementPresentByXpath("//div[@data-parent='Demo-GridLayoutManager-Example5']/table/tbody/tr/td[@rowspan='3']");
82 }
83
84 protected void testLayoutManagersGridLayoutFieldGroup() throws Exception {
85 selectByName("exampleShown","Field Group");
86 assertElementPresentByXpath("//div[@data-parent='Demo-GridLayoutManager-Example6']/table/tbody/tr/td/label");
87 assertElementPresentByXpath("//div[@data-parent='Demo-GridLayoutManager-Example6']/table/tbody/tr/td/div[@class='uif-horizontalFieldGroup']");
88 }
89
90 protected void testLayoutManagersGridLayoutNestedLayout() throws Exception {
91 selectByName("exampleShown","Nested Layout");
92 assertElementPresentByXpath("//section[@id='Demo-GridLayoutManager-Example7']/div/table/tbody/tr/th[@class='uif-gridLayoutCell']/section/table");
93 assertElementPresentByXpath("//section[@id='Demo-GridLayoutManager-Example7']/div/table/tbody/tr/td[@class='uif-gridLayoutCell']/section/table");
94 }
95
96 @Test
97 public void testLayoutManagersGridLayoutBookmark() throws Exception {
98 testLayoutManagersGridLayoutAll();
99 }
100
101 @Test
102 public void testLayoutManagersGridLayoutNav() throws Exception {
103 testLayoutManagersGridLayoutAll();
104 }
105
106 private void testLayoutManagersGridLayoutAll() throws Exception {
107 testLayoutManagersGridLayout();
108 testLayoutManagersGridLayouMultipleColumns();
109 testLayoutManagersGridLayoutColumnSpan();
110 testLayoutManagersGridLayoutRenderTHColumn();
111 testLayoutManagersGridLayoutRowSpan();
112 testLayoutManagersGridLayoutFieldGroup();
113 testLayoutManagersGridLayoutNestedLayout();
114 passed();
115 }
116 }