Author: lfryc(a)redhat.com
Date: 2011-01-22 14:04:35 -0500 (Sat, 22 Jan 2011)
New Revision: 21156
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/components1.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/components2.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/facets.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/filtering.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/scroller.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/simple.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/sorting-using-column.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/CollapsibleSubTable.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTable/CollapsibleSubTableAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTable/TestCollapsibleSubTableSimple.java
Log:
integrated fixes for RF-10181, RF-10217
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableBean.java 2011-01-21
16:03:53 UTC (rev 21155)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableBean.java 2011-01-22
19:04:35 UTC (rev 21156)
@@ -79,6 +79,9 @@
// filtering
private Map<String, Object> filtering = new HashMap<String, Object>();
+
+ // expanded
+ private Map<List<Employee>, Boolean> expanded = new
HashMap<List<Employee>, Boolean>();
/**
* Initializes the managed bean.
@@ -89,12 +92,12 @@
logger.debug("initializing bean " + getClass().getName());
attributes =
Attributes.getComponentAttributesFromFacesConfig(UICollapsibleSubTable.class,
getClass());
-
- attributes.setAttribute("expanded", true);
+
attributes.setAttribute("rendered", true);
attributes.setAttribute("rows", 5);
// TODO these attributes have to be tested in another way
+ attributes.remove("expanded");
attributes.remove("columns");
attributes.remove("selection");
attributes.remove("filterVar");
@@ -120,6 +123,9 @@
lists = new ArrayList<List<Employee>>();
lists.add(men);
lists.add(women);
+
+ expanded.put(men, true);
+ expanded.put(women, true);
state = true;
}
@@ -175,4 +181,8 @@
public Map<String, Object> getFiltering() {
return filtering;
}
+
+ public Map<List<Employee>, Boolean> getExpanded() {
+ return expanded;
+ }
}
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java 2011-01-21
16:03:53 UTC (rev 21155)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java 2011-01-22
19:04:35 UTC (rev 21156)
@@ -28,7 +28,6 @@
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
-import java.util.TreeMap;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/components1.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/components1.xhtml 2011-01-21
16:03:53 UTC (rev 21155)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/components1.xhtml 2011-01-22
19:04:35 UTC (rev 21156)
@@ -42,7 +42,7 @@
<ui:define name="component">
- <rich:dataTable id="dataTable"
value="#{richSubTableBean.lists}" var="list">
+ <rich:dataTable id="dataTable"
value="#{richSubTableBean.lists}" var="list"
keepSaved="true">
<f:facet name="header">
<rich:columnGroup>
<rich:column id="columnHeaderEmployees"
colspan="6">
@@ -87,7 +87,6 @@
<rich:collapsibleSubTable id="richSubTable"
breakBefore="#{richSubTableBean.attributes['breakBefore'].value}"
expandMode="#{richSubTableBean.attributes['expandMode'].value}"
-
expanded="#{richSubTableBean.attributes['expanded'].value}"
filterVar="#{richSubTableBean.attributes['filterVar'].value}"
filteringListeners="#{richSubTableBean.attributes['filteringListeners'].value}"
first="#{richSubTableBean.attributes['first'].value}"
@@ -113,6 +112,12 @@
sortPriority="#{richSubTableBean.attributes['sortPriority'].value}"
sortingListeners="#{richSubTableBean.attributes['sortingListeners'].value}"
toggleListeners="#{richSubTableBean.attributes['toggleListeners'].value}"
+
columnClasses="#{richSubTableBean.attributes['columnClasses'].value}"
+
footerClass="#{richSubTableBean.attributes['footerClass'].value}"
+
headerClass="#{richSubTableBean.attributes['headerClass'].value}"
+
rowClass="#{richSubTableBean.attributes['rowClass'].value}"
+
rowClasses="#{richSubTableBean.attributes['rowClasses'].value}"
+
expanded="#{richSubTableBean.expanded[list]}"
value="#{list}"
var="item">
<rich:column id="columnSex">
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/components2.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/components2.xhtml 2011-01-21
16:03:53 UTC (rev 21155)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/components2.xhtml 2011-01-22
19:04:35 UTC (rev 21156)
@@ -41,7 +41,7 @@
<ui:define name="component">
- <rich:dataTable id="dataTable"
value="#{richSubTableBean.lists}" var="list">
+ <rich:dataTable id="dataTable"
value="#{richSubTableBean.lists}" var="list"
keepSaved="true">
<f:facet name="header">
<rich:columnGroup>
<rich:column id="columnHeaderEmployees"
colspan="6">
@@ -86,7 +86,6 @@
<rich:collapsibleSubTable id="richSubTable"
breakBefore="#{richSubTableBean.attributes['breakBefore'].value}"
expandMode="#{richSubTableBean.attributes['expandMode'].value}"
-
expanded="#{richSubTableBean.attributes['expanded'].value}"
filterVar="#{richSubTableBean.attributes['filterVar'].value}"
filteringListeners="#{richSubTableBean.attributes['filteringListeners'].value}"
first="#{richSubTableBean.attributes['first'].value}"
@@ -112,6 +111,12 @@
sortPriority="#{richSubTableBean.attributes['sortPriority'].value}"
sortingListeners="#{richSubTableBean.attributes['sortingListeners'].value}"
toggleListeners="#{richSubTableBean.attributes['toggleListeners'].value}"
+
columnClasses="#{richSubTableBean.attributes['columnClasses'].value}"
+
footerClass="#{richSubTableBean.attributes['footerClass'].value}"
+
headerClass="#{richSubTableBean.attributes['headerClass'].value}"
+
rowClass="#{richSubTableBean.attributes['rowClass'].value}"
+
rowClasses="#{richSubTableBean.attributes['rowClasses'].value}"
+
expanded="#{richSubTableBean.expanded[list]}"
value="#{list}"
var="item">
<rich:column id="columnSex">
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/facets.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/facets.xhtml 2011-01-21
16:03:53 UTC (rev 21155)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/facets.xhtml 2011-01-22
19:04:35 UTC (rev 21156)
@@ -47,10 +47,8 @@
</ui:define>
<ui:define name="component">
-
- #{nestedComponentId}
- <rich:dataTable id="richDataTable"
value="#{richSubTableBean.lists}" var="list">
+ <rich:dataTable id="richDataTable"
value="#{richSubTableBean.lists}" var="list"
keepSaved="true">
<f:facet name="header">
<rich:columnGroup id="columnGroup">
<rich:column id="columnHeaderEmployees"
colspan="3">
@@ -76,7 +74,6 @@
<rich:collapsibleSubTable id="richSubTable"
breakBefore="#{richSubTableBean.attributes['breakBefore'].value}"
expandMode="#{richSubTableBean.attributes['expandMode'].value}"
-
expanded="#{richSubTableBean.attributes['expanded'].value}"
filterVar="#{richSubTableBean.attributes['filterVar'].value}"
filteringListeners="#{richSubTableBean.attributes['filteringListeners'].value}"
first="#{richSubTableBean.attributes['first'].value}"
@@ -102,6 +99,12 @@
sortPriority="#{richSubTableBean.attributes['sortPriority'].value}"
sortingListeners="#{richSubTableBean.attributes['sortingListeners'].value}"
toggleListeners="#{richSubTableBean.attributes['toggleListeners'].value}"
+
columnClasses="#{richSubTableBean.attributes['columnClasses'].value}"
+
footerClass="#{richSubTableBean.attributes['footerClass'].value}"
+
headerClass="#{richSubTableBean.attributes['headerClass'].value}"
+
rowClass="#{richSubTableBean.attributes['rowClass'].value}"
+
rowClasses="#{richSubTableBean.attributes['rowClasses'].value}"
+
expanded="#{richSubTableBean.expanded[list]}"
value="#{richSubTableBean.state ? list :
null}"
var="item">
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/filtering.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/filtering.xhtml 2011-01-21
16:03:53 UTC (rev 21155)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/filtering.xhtml 2011-01-22
19:04:35 UTC (rev 21156)
@@ -48,7 +48,7 @@
<ui:define name="component">
- <rich:dataTable id="richDataTable"
value="#{richSubTableBean.lists}" var="list">
+ <rich:dataTable id="richDataTable"
value="#{richSubTableBean.lists}" var="list"
keepSaved="true">
<f:facet name="header">
<rich:columnGroup id="columnGroup">
<rich:column id="columnHeaderEmployees"
colspan="3">
@@ -86,7 +86,6 @@
<rich:collapsibleSubTable id="richSubTable"
breakBefore="#{richSubTableBean.attributes['breakBefore'].value}"
expandMode="#{richSubTableBean.attributes['expandMode'].value}"
-
expanded="#{richSubTableBean.attributes['expanded'].value}"
filterVar="#{richSubTableBean.attributes['filterVar'].value}"
filteringListeners="#{richSubTableBean.attributes['filteringListeners'].value}"
first="#{richSubTableBean.attributes['first'].value}"
@@ -112,6 +111,12 @@
sortPriority="#{richSubTableBean.attributes['sortPriority'].value}"
sortingListeners="#{richSubTableBean.attributes['sortingListeners'].value}"
toggleListeners="#{richSubTableBean.attributes['toggleListeners'].value}"
+
columnClasses="#{richSubTableBean.attributes['columnClasses'].value}"
+
footerClass="#{richSubTableBean.attributes['footerClass'].value}"
+
headerClass="#{richSubTableBean.attributes['headerClass'].value}"
+
rowClass="#{richSubTableBean.attributes['rowClass'].value}"
+
rowClasses="#{richSubTableBean.attributes['rowClasses'].value}"
+
expanded="#{richSubTableBean.expanded[list]}"
value="#{richSubTableBean.state ? list :
null}"
var="item">
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/scroller.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/scroller.xhtml 2011-01-21
16:03:53 UTC (rev 21155)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/scroller.xhtml 2011-01-22
19:04:35 UTC (rev 21156)
@@ -47,7 +47,7 @@
<ui:define name="component">
- <rich:dataTable id="richDataTable"
value="#{richSubTableBean.lists}" var="list">
+ <rich:dataTable id="richDataTable"
value="#{richSubTableBean.lists}" var="list"
keepSaved="true">
<f:facet name="header">
<rich:columnGroup id="columnGroup">
<rich:column id="columnHeaderEmployees"
colspan="3">
@@ -73,7 +73,6 @@
<rich:collapsibleSubTable id="richSubTable"
breakBefore="#{richSubTableBean.attributes['breakBefore'].value}"
expandMode="#{richSubTableBean.attributes['expandMode'].value}"
-
expanded="#{richSubTableBean.attributes['expanded'].value}"
filterVar="#{richSubTableBean.attributes['filterVar'].value}"
filteringListeners="#{richSubTableBean.attributes['filteringListeners'].value}"
first="#{richSubTableBean.attributes['first'].value}"
@@ -99,6 +98,12 @@
sortPriority="#{richSubTableBean.attributes['sortPriority'].value}"
sortingListeners="#{richSubTableBean.attributes['sortingListeners'].value}"
toggleListeners="#{richSubTableBean.attributes['toggleListeners'].value}"
+
columnClasses="#{richSubTableBean.attributes['columnClasses'].value}"
+
footerClass="#{richSubTableBean.attributes['footerClass'].value}"
+
headerClass="#{richSubTableBean.attributes['headerClass'].value}"
+
rowClass="#{richSubTableBean.attributes['rowClass'].value}"
+
rowClasses="#{richSubTableBean.attributes['rowClasses'].value}"
+
expanded="#{richSubTableBean.expanded[list]}"
value="#{richSubTableBean.state ? list :
null}"
var="item">
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/simple.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/simple.xhtml 2011-01-21
16:03:53 UTC (rev 21155)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/simple.xhtml 2011-01-22
19:04:35 UTC (rev 21156)
@@ -47,7 +47,7 @@
<ui:define name="component">
- <rich:dataTable id="richDataTable"
value="#{richSubTableBean.lists}" var="list">
+ <rich:dataTable id="richDataTable"
value="#{richSubTableBean.lists}" var="list"
keepSaved="true">
<f:facet name="header">
<rich:columnGroup id="columnGroup">
<rich:column id="columnHeaderEmployees"
colspan="3">
@@ -73,7 +73,6 @@
<rich:collapsibleSubTable id="richSubTable"
breakBefore="#{richSubTableBean.attributes['breakBefore'].value}"
expandMode="#{richSubTableBean.attributes['expandMode'].value}"
-
expanded="#{richSubTableBean.attributes['expanded'].value}"
filterVar="#{richSubTableBean.attributes['filterVar'].value}"
filteringListeners="#{richSubTableBean.attributes['filteringListeners'].value}"
first="#{richSubTableBean.attributes['first'].value}"
@@ -99,6 +98,12 @@
sortPriority="#{richSubTableBean.attributes['sortPriority'].value}"
sortingListeners="#{richSubTableBean.attributes['sortingListeners'].value}"
toggleListeners="#{richSubTableBean.attributes['toggleListeners'].value}"
+
columnClasses="#{richSubTableBean.attributes['columnClasses'].value}"
+
footerClass="#{richSubTableBean.attributes['footerClass'].value}"
+
headerClass="#{richSubTableBean.attributes['headerClass'].value}"
+
rowClass="#{richSubTableBean.attributes['rowClass'].value}"
+
rowClasses="#{richSubTableBean.attributes['rowClasses'].value}"
+
expanded="#{richSubTableBean.expanded[list]}"
value="#{richSubTableBean.state ? list :
null}"
var="item">
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/sorting-using-column.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/sorting-using-column.xhtml 2011-01-21
16:03:53 UTC (rev 21155)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/sorting-using-column.xhtml 2011-01-22
19:04:35 UTC (rev 21156)
@@ -47,7 +47,7 @@
<ui:define name="component">
- <rich:dataTable id="richDataTable"
value="#{richSubTableBean.lists}" var="list">
+ <rich:dataTable id="richDataTable"
value="#{richSubTableBean.lists}" var="list"
keepSaved="true">
<f:facet name="header">
<rich:columnGroup id="columnGroup">
<rich:column id="columnHeaderEmployees"
colspan="3">
@@ -74,7 +74,6 @@
binding="#{richSubTableBean.binding}"
breakBefore="#{richSubTableBean.attributes['breakBefore'].value}"
expandMode="#{richSubTableBean.attributes['expandMode'].value}"
-
expanded="#{richSubTableBean.attributes['expanded'].value}"
filterVar="#{richSubTableBean.attributes['filterVar'].value}"
filteringListeners="#{richSubTableBean.attributes['filteringListeners'].value}"
first="#{richSubTableBean.attributes['first'].value}"
@@ -100,6 +99,12 @@
sortPriority="#{richSubTableBean.attributes['sortPriority'].value}"
sortingListeners="#{richSubTableBean.attributes['sortingListeners'].value}"
toggleListeners="#{richSubTableBean.attributes['toggleListeners'].value}"
+
columnClasses="#{richSubTableBean.attributes['columnClasses'].value}"
+
footerClass="#{richSubTableBean.attributes['footerClass'].value}"
+
headerClass="#{richSubTableBean.attributes['headerClass'].value}"
+
rowClass="#{richSubTableBean.attributes['rowClass'].value}"
+
rowClasses="#{richSubTableBean.attributes['rowClasses'].value}"
+
expanded="#{richSubTableBean.expanded[list]}"
value="#{richSubTableBean.state ? list :
null}"
var="item">
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/CollapsibleSubTable.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/CollapsibleSubTable.java 2011-01-21
16:03:53 UTC (rev 21155)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/CollapsibleSubTable.java 2011-01-22
19:04:35 UTC (rev 21156)
@@ -5,6 +5,7 @@
import org.jboss.test.selenium.framework.AjaxSelenium;
import org.jboss.test.selenium.framework.AjaxSeleniumProxy;
+import org.jboss.test.selenium.locator.ElementLocator;
import org.jboss.test.selenium.locator.ExtendedLocator;
import org.jboss.test.selenium.locator.JQueryLocator;
import org.jboss.test.selenium.locator.reference.ReferencedLocator;
@@ -13,7 +14,7 @@
AjaxSelenium selenium = AjaxSeleniumProxy.getInstance();
- JQueryLocator subtableRow = jq("tr[class^=rf-cst][class$=-r]");
+ JQueryLocator subtableRow = jq("tr[class*=rf-cst-][class*=-r]");
JQueryLocator subtableCell = jq("td.rf-cst-c");
ReferencedLocator<JQueryLocator> noData = ref(root, "> tr.rf-cst-nd
> td.rf-cst-nd-c");
@@ -25,6 +26,14 @@
public CollapsibleSubTable(JQueryLocator root) {
super(root);
}
+
+ public JQueryLocator getAnyRow() {
+ return root.getLocator().getChild(subtableRow);
+ }
+
+ public JQueryLocator getAnyCellInColumn(int column) {
+ return
root.getLocator().getChild(subtableRow).getChild(subtableCell).getNthChildElement(column);
+ }
public Iterable<JQueryLocator> getRows() {
return root.getLocator().getChildren(subtableRow);
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTable/CollapsibleSubTableAttributes.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTable/CollapsibleSubTableAttributes.java 2011-01-21
16:03:53 UTC (rev 21155)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTable/CollapsibleSubTableAttributes.java 2011-01-22
19:04:35 UTC (rev 21156)
@@ -80,4 +80,24 @@
public void setSortPriority(Collection<String> sortPriority) {
setProperty("sortPriority", sortPriority);
}
+
+ public void setColumnClasses(String columnClasses) {
+ setProperty("columnClasses", columnClasses);
+ }
+
+ public void setRowClasses(String rowClasses) {
+ setProperty("rowClasses", rowClasses);
+ }
+
+ public void setRowClass(String rowClass) {
+ setProperty("rowClass", rowClass);
+ }
+
+ public void setHeaderClass(String headerClass) {
+ setProperty("headerClass", headerClass);
+ }
+
+ public void setFooterClass(String footerClass) {
+ setProperty("footerClass", footerClass);
+ }
}
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTable/TestCollapsibleSubTableSimple.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTable/TestCollapsibleSubTableSimple.java 2011-01-21
16:03:53 UTC (rev 21155)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTable/TestCollapsibleSubTableSimple.java 2011-01-22
19:04:35 UTC (rev 21156)
@@ -21,16 +21,18 @@
*******************************************************************************/
package org.richfaces.tests.metamer.ftest.richCollapsibleSubTable;
+import static org.jboss.test.selenium.JQuerySelectors.append;
+import static org.jboss.test.selenium.JQuerySelectors.not;
import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guard;
import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
-import static org.testng.Assert.fail;
import java.net.URL;
import java.util.List;
+import org.jboss.test.selenium.locator.JQueryLocator;
import org.jboss.test.selenium.request.RequestType;
import org.richfaces.ExpandMode;
import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
@@ -51,7 +53,6 @@
@Test
@Use(field = "expandMode", enumeration = true)
- @IssueTracking("https://issues.jboss.org/browse/RF-10181")
public void testExpandMode() {
final RequestType requestType = getRequestTypeForExpandMode();
@@ -144,10 +145,40 @@
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-10217")
- @Use(field = "configuration", empty = true)
- public void testClasses() {
- // TODO classes are currently not working
- fail();
+ public void testColumnClasses() {
+ attributes.setColumnClasses("col1,col2,col3");
+ for (int i = 1; i <= 3; i++) {
+ JQueryLocator anyCellInColumn = subtable.getAnyCellInColumn(i);
+ JQueryLocator haveClassSet = append(anyCellInColumn, ".col" + i);
+ JQueryLocator haveNotClassSet = not(anyCellInColumn, ".col" + i);
+ assertTrue(selenium.isElementPresent(haveClassSet) &&
selenium.isVisible(haveClassSet));
+ assertFalse(selenium.isElementPresent(haveNotClassSet));
+ }
}
+
+ @Test
+ public void testRowClasses() {
+ attributes.setRows(13);
+ attributes.setRowClasses("row1,row2,row3");
+
+ int rowCount = subtable.getRowCount();
+ assertEquals(rowCount, 13);
+
+ for (int i = 1; i <= rowCount; i++) {
+ JQueryLocator row = subtable.getRow(i);
+ selenium.belongsClass(row, "row" + (i + 1 % 3));
+ }
+ }
+
+ @Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-10212")
+ public void testRowClass() {
+ attributes.setRows(13);
+ attributes.setRowClass("rowClass");
+ JQueryLocator anyRow = subtable.getAnyRow();
+ JQueryLocator haveClassSet = append(anyRow, ".rowClass");
+ JQueryLocator haveNotClassSet = not(append(anyRow, ":visible"),
".rowClass");
+ assertEquals(selenium.getCount(haveClassSet), 13);
+ assertEquals(selenium.getCount(haveNotClassSet), 0);
+ }
}