Author: dsvyatobatsko
Date: 2008-10-24 06:46:06 -0400 (Fri, 24 Oct 2008)
New Revision: 10894
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/panelBar/panelBarTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/PanelBarTest.java
Log:
https://jira.jboss.org/jira/browse/RF-4674
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/panelBar/panelBarTest.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/PanelBarTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/PanelBarTest.java 2008-10-24
10:28:55 UTC (rev 10893)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/PanelBarTest.java 2008-10-24
10:46:06 UTC (rev 10894)
@@ -32,6 +32,10 @@
public class PanelBarTest extends SeleniumTestBase {
+ private static final String PANEL_BAR_ID = "panelBarId";
+
+ private static final String PANEL_BAR_ITEM_ID = "item1";
+
@Test
public void testPanelBarComponent(Template template) {
renderPage(template);
@@ -137,25 +141,35 @@
assertEvents(eventsExpected);
}
+ @Test
+ public void testStyleAndClassesAreOutputToClient(Template template) {
+ renderPage(template);
-// @Test
-// public void testStyleAndClassesAreOutputToClient(Template template) {
-// renderPage(template);
-//
-// writeStatus("Check style and classes are output to client");
-//
-// String compDivId = getParentId() + "_form:panel1";
-//
-// String headerDivId = compDivId + "_header";
-// String bodyDivId = compDivId + "_body";
-//
-// assertStyleAttribute(compDivId, "font-size: 13px", "Style
attribute was not output to client");
-// assertClassNames(compDivId, new String[] { "noclass" }, "Class
attribute was not output to client", true);
-//
-// assertClassNames(headerDivId, new String[] { "header-class" },
"headerClass attribute was not output to client", true);
-// assertClassNames(bodyDivId, new String[] { "body-class" },
"bodyClass attribute was not output to client", true);
-// }
+ writeStatus("Check style and classes are output to client");
+ String itemDivId = getParentId() + "_form:" + PANEL_BAR_ITEM_ID;
+
+ String contentElemXpath = "//div[@id='" + itemDivId +
"']/div[3]/table/tbody/tr/td";
+ assertClassAttributeContains(contentElemXpath, "content-class",
"contentClass attribute was not output to client");
+ assertStyleAttributeContains(contentElemXpath, "font-size: 14px",
"contentStyle attribute was not output to client");
+
+ String headerElementXpath = "//div[@id='" + itemDivId +
"']/div[1]";
+ assertClassAttributeContains(headerElementXpath, "header-class",
"headerClass attribute was not output to client");
+ assertStyleAttributeContains(headerElementXpath, "font-size: 13px",
"headerStyle attribute was not output to client");
+
+ String activeHeaderElementXpath = "//div[@id='" + itemDivId +
"']/div[2]";
+ assertClassAttributeContains(activeHeaderElementXpath,
"header-class-active", "headerClassActive attribute was not output to
client");
+ assertStyleAttributeContains(activeHeaderElementXpath, "font-size:
12px", "headerStyleActive attribute was not output to client");
+
+ String compDivId = getParentId() + "_form:" + PANEL_BAR_ID;
+
+ assertClassAttributeContains(compDivId, "noclass", "Class
attribute was not output to client");
+ assertStyleAttributeContains(compDivId, "font-size: 11px", "Style
attribute was not output to client");
+
+ assertStyleAttributeContains(compDivId, "width: 300px", "width
attribute was not output to client");
+ assertStyleAttributeContains(compDivId, "height: 200px", "height
attribute was not output to client");
+ }
+
public String getTestUrl() {
return "pages/panelBar/panelBarTest.xhtml";
}