Author: dsvyatobatsko
Date: 2008-10-03 10:03:14 -0400 (Fri, 03 Oct 2008)
New Revision: 10660
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxStatusTest.java
Log:
AjaxStatus: style and classes, standard HTML attributes are output to client
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-10-03
13:20:20 UTC (rev 10659)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-10-03
14:03:14 UTC (rev 10660)
@@ -871,10 +871,17 @@
* @param expectedExpression - expected style attribute
*/
public void assertStyleAttribute(String elementId, String expectedExpression) {
- String styleAttribute = selenium.getAttribute("//*[@id='" + elementId +
"']/@style");
- if (!styleAttribute.toLowerCase().contains(expectedExpression.toLowerCase())) {
- Assert.fail("Element '" + elementId + "' with style
'" + styleAttribute + "' doesn't contain '" +
expectedExpression + "'");
- }
+ String styleAttribute = null;
+ try {
+ styleAttribute = selenium.getAttribute("//*[@id='" + elementId
+ "']/@style");
+ } catch (Throwable e) {
+ // consume exception
+ }
+
+ if (null == styleAttribute ||
!styleAttribute.toLowerCase().contains(expectedExpression.toLowerCase())) {
+ Assert.fail("Element '" + elementId + "' with style
'" + styleAttribute + "' doesn't contain '"
+ + expectedExpression + "'");
+ }
}
/**
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxStatusTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxStatusTest.java 2008-10-03
13:20:20 UTC (rev 10659)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxStatusTest.java 2008-10-03
14:03:14 UTC (rev 10660)
@@ -139,6 +139,18 @@
assertEvents(eventsExpected);
}
+ @Test
+ public void testStyleAndClassesStandardHTMLAttributesAreOutputToClient(Template
template) {
+ renderPage(template);
+
+ writeStatus("Check style and classes, standard HTML attributes are output to
client");
+
+ String statusElemId = getParentId() + "_form:" + STATUS_1_ID;
+
+ assertStyleAttribute(statusElemId, "font-size: 13px");
+ assertClassNames(statusElemId, new String[] { "noclass" }, "Class
attribute was not output to client ", true);
+ }
+
public String getTestUrl() {
return "pages/ajaxStatus/ajaxStatusTest.xhtml";
}
Show replies by date