Author: dsvyatobatsko
Date: 2009-02-18 04:53:52 -0500 (Wed, 18 Feb 2009)
New Revision: 12687
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataFilterSlider/dataFilterSliderTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataFilterSliderTest.java
Log:
https://jira.jboss.org/jira/browse/RF-5991
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataFilterSlider/dataFilterSliderTest.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataFilterSliderTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataFilterSliderTest.java 2009-02-18
01:41:36 UTC (rev 12686)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataFilterSliderTest.java 2009-02-18
09:53:52 UTC (rev 12687)
@@ -20,8 +20,12 @@
*/
package org.richfaces.testng;
+import java.util.ArrayList;
+import java.util.List;
+
import org.ajax4jsf.template.Template;
import org.richfaces.AutoTester;
+import org.richfaces.SeleniumEvent;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
import org.testng.annotations.Test;
@@ -34,6 +38,12 @@
private static final String DATA_FLT_SLIDER_TRACK = DATA_FLT_SLIDER_ID +
"slider-track";
+ private static final String DATA_FLT_SLIDER_HANDLE = DATA_FLT_SLIDER_ID +
"slider-handle";
+
+ private static final String DATA_FLT_SLIDER_RANGE = DATA_FLT_SLIDER_ID +
"slider-range";
+
+ private static final String DATA_FLT_SLIDER_TRAILER = DATA_FLT_SLIDER_ID +
"slider-trailer";
+
private static final String TABLE = "planetList";
private static final int PLANETS_ALL = 11;
@@ -273,6 +283,52 @@
tester.testBypassUpdate();
}
+ @Test
+ public void testStandardHTMLAttributesAreOutputToClient(Template template) {
+ renderPage(template, null);
+
+ writeStatus("Check component's specific HTML attributes are output to
client");
+
+ List<SeleniumEvent> events = new ArrayList<SeleniumEvent>();
+ events.add(SeleniumEvent.ONKEYDOWN);
+ events.add(SeleniumEvent.ONKEYUP);
+ events.add(SeleniumEvent.ONKEYPRESS);
+
+ assertEvents(getParentId() + FORM_ID + DATA_FLT_SLIDER_INPUT, events);
+
+ writeStatus("Check standart HTML attributes");
+ //String sliderContainerXpath = "//div[contains(@class,
'slider-container')]";
+ //assertEvents(sliderContainerXpath, SeleniumEvent.STANDARD_HTML_EVENTS);
+ }
+
+ @Test
+ public void testStylesAndStyleClassesAreOutputToClient(Template template) {
+ renderPage(template, null);
+
+ writeStatus("Check styles and classes are output to client");
+
+ writeStatus("Check styleClass/style attributes");
+ String sliderContainerXpath = "//div[contains(@class,
'slider-container')]";
+ assertStyleAttributeContains(sliderContainerXpath, "font-size: 16px",
"Style attribute was not output to client");
+ assertClassAttributeContains(sliderContainerXpath, "noclass",
"Class attribute was not output to client");
+
+ writeStatus("Check trackStyleClass attribute");
+ String sliderTrackId = getParentId() + FORM_ID + DATA_FLT_SLIDER_TRACK;
+ assertClassAttributeContains(sliderTrackId, "track-style-class",
"trackStyleClass attribute was not output to client");
+
+ writeStatus("Check handleStyleClass attribute");
+ String sliderHandleId = getParentId() + FORM_ID + DATA_FLT_SLIDER_HANDLE;
+ assertClassAttributeContains(sliderHandleId, "handle-style-class",
"handleStyleClass attribute was not output to client");
+
+ writeStatus("Check rangeStyleClass attribute");
+ String sliderRangeId = getParentId() + FORM_ID + DATA_FLT_SLIDER_RANGE;
+ assertClassAttributeContains(sliderRangeId, "range-style-class",
"rangeStyleClass attribute was not output to client");
+
+ writeStatus("Check trailerStyleClass attribute");
+ String sliderTrailerId = getParentId() + FORM_ID + DATA_FLT_SLIDER_TRAILER;
+ assertClassAttributeContains(sliderTrailerId, "trailer-style-class",
"trailerStyleClass attribute was not output to client");
+ }
+
private void clickSlider(int position) {
String trackId = getParentId() + FORM_ID + DATA_FLT_SLIDER_TRACK;
int w = selenium.getElementWidth(trackId).intValue();