Author: ppitonak(a)redhat.com
Date: 2010-09-17 11:09:12 -0400 (Fri, 17 Sep 2010)
New Revision: 19242
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richAccordion/simple.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAccordion/TestRichAccordion.java
Log:
https://jira.jboss.org/browse/RFPL-674
* small fix for page with accordion
* added 3 tests for accordion - width, height, title
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richAccordion/simple.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richAccordion/simple.xhtml 2010-09-17
14:11:41 UTC (rev 19241)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richAccordion/simple.xhtml 2010-09-17
15:09:12 UTC (rev 19242)
@@ -48,6 +48,7 @@
dir="#{richAccordionBean.attributes['dir'].value}"
execute="#{richAccordionBean.attributes['execute'].value}"
firstItem="#{richAccordionBean.attributes['firstItem'].value}"
+
height="#{richAccordionBean.attributes['height'].value}"
immediate="#{richAccordionBean.attributes['immediate'].value}"
itemByIndex="#{richAccordionBean.attributes['itemByIndex'].value}"
itemChangeListener="#{richAccordionBean.attributes['itemChangeListener'].value}"
@@ -75,6 +76,7 @@
prevItem="#{richAccordionBean.attributes['prevItem'].value}"
render="#{richAccordionBean.attributes['render'].value}"
rendered="#{richAccordionBean.attributes['rendered'].value}"
+
renderedItems="#{richAccordionBean.attributes['renderedItems'].value}"
required="#{richAccordionBean.attributes['required'].value}"
status="#{richAccordionBean.attributes['status'].value}"
style="#{richAccordionBean.attributes['style'].value}"
@@ -85,6 +87,7 @@
title="#{richAccordionBean.attributes['title'].value}"
valid="#{richAccordionBean.attributes['valid'].value}"
value="#{richAccordionBean.attributes['value'].value}"
+
width="#{richAccordionBean.attributes['width'].value}"
<rich:accordionItem id="item1" name="item1"
header="Item 1">
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAccordion/TestRichAccordion.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAccordion/TestRichAccordion.java 2010-09-17
14:11:41 UTC (rev 19241)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAccordion/TestRichAccordion.java 2010-09-17
15:09:12 UTC (rev 19242)
@@ -33,6 +33,7 @@
import java.net.URL;
+import org.jboss.test.selenium.css.CssProperty;
import org.jboss.test.selenium.dom.Event;
import org.jboss.test.selenium.encapsulated.JavaScript;
import org.jboss.test.selenium.locator.Attribute;
@@ -199,6 +200,23 @@
}
@Test
+ public void testHeight() {
+ JQueryLocator input = pjq("input[type=text][id$=heightInput]");
+ AttributeLocator<?> attribute = accordion.getAttribute(new
Attribute("style"));
+
+ // height = null
+ assertFalse(selenium.isAttributePresent(attribute), "Attribute style should
not be present.");
+
+ // height = 300px
+ selenium.type(input, "300px");
+ selenium.waitForPageToLoad(TIMEOUT);
+
+ assertTrue(selenium.isAttributePresent(attribute), "Attribute style should
be present.");
+ String value = selenium.getStyle(accordion, CssProperty.HEIGHT);
+ assertEquals(value, "300px", "Attribute width");
+ }
+
+ @Test
public void testImmediate() {
JQueryLocator input = pjq("input[type=checkbox][id$=immediateInput]");
selenium.click(input);
@@ -344,4 +362,37 @@
testStyleClass(accordion, "styleClass");
}
+ @Test
+ public void testTitle() {
+ JQueryLocator input = pjq("input[type=text][id$=titleInput]");
+ AttributeLocator<?> attribute = accordion.getAttribute(new
Attribute("title"));
+
+ // title = null
+ assertFalse(selenium.isAttributePresent(attribute), "Attribute title should
not be present.");
+
+ // title = "RichFaces Accordion"
+ selenium.type(input, "RichFaces Accordion");
+ selenium.waitForPageToLoad(TIMEOUT);
+
+ assertTrue(selenium.isAttributePresent(attribute), "Attribute title should
be present.");
+ String value = selenium.getAttribute(attribute);
+ assertEquals(value, "RichFaces Accordion", "Attribute
title");
+ }
+
+ @Test
+ public void testWidth() {
+ JQueryLocator input = pjq("input[type=text][id$=widthInput]");
+ AttributeLocator<?> attribute = accordion.getAttribute(new
Attribute("style"));
+
+ // width = null
+ assertFalse(selenium.isAttributePresent(attribute), "Attribute style should
not be present.");
+
+ // width = 50%
+ selenium.type(input, "50%");
+ selenium.waitForPageToLoad(TIMEOUT);
+
+ assertTrue(selenium.isAttributePresent(attribute), "Attribute style should
be present.");
+ String value = selenium.getStyle(accordion, CssProperty.WIDTH);
+ assertEquals(value, "50%", "Attribute width");
+ }
}