Author: ppitonak(a)redhat.com
Date: 2011-01-17 07:58:47 -0500 (Mon, 17 Jan 2011)
New Revision: 21046
Modified:
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/CommandButtonBean.properties
modules/tests/metamer/trunk/application/src/main/webapp/components/commandButton/simple.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/hCommandButton/TestHCommandButton.java
Log:
* fixed sample and tests for h:commandButton
Modified:
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/CommandButtonBean.properties
===================================================================
---
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/CommandButtonBean.properties 2011-01-17
12:31:59 UTC (rev 21045)
+++
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/CommandButtonBean.properties 2011-01-17
12:58:47 UTC (rev 21046)
@@ -5,9 +5,3 @@
attr.actionListener.first6CharsActionListener=first6CharsActionListener
attr.actionListener.doubleStringActionListener=doubleStringActionListener
attr.actionListener.toUpperCaseActionListener=toUpperCaseActionListener
-
-attr.styleClass.bold=bold
-attr.styleClass.strike=strike
-attr.styleClass.big=big
-attr.styleClass.wide=wide
-attr.styleClass.none=
\ No newline at end of file
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/commandButton/simple.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/commandButton/simple.xhtml 2011-01-17
12:31:59 UTC (rev 21045)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/commandButton/simple.xhtml 2011-01-17
12:58:47 UTC (rev 21046)
@@ -5,7 +5,7 @@
<!--
JBoss, Home of Professional Open Source
-Copyright 2010, Red Hat, Inc. and individual contributors
+Copyright 2010-2011, Red Hat, Inc. and individual contributors
by the @authors tag. See the copyright.txt in the distribution for a
full listing of individual contributors.
@@ -33,8 +33,6 @@
<f:converter converterId="templatesListConverter" />
</f:viewParam>
</f:metadata>
-
- <h:outputStylesheet library="css"
name="commandButton.css"/>
</ui:define>
<ui:define name="outOfTemplateBefore">
@@ -46,12 +44,20 @@
<h:inputText id="input"
value="#{buttonBean.input}" />
<h:commandButton id="commandButton"
+
accesskey="#{buttonBean.attributes['accesskey'].value}"
action="#{buttonBean.attributes.action}"
actionListener="#{buttonBean.attributes.actionListener}"
+
alt="#{buttonBean.attributes['alt'].value}"
+
dir="#{buttonBean.attributes['dir'].value}"
disabled="#{buttonBean.attributes['disabled'].value}"
immediate="#{buttonBean.attributes['immediate'].value}"
+
label="#{buttonBean.attributes['label'].value}"
+
lang="#{buttonBean.attributes['lang'].value}"
+
onblur="#{buttonBean.attributes['onblur'].value}"
+
onchange="#{buttonBean.attributes['onchange'].value}"
onclick="#{buttonBean.attributes['onclick'].value}"
ondblclick="#{buttonBean.attributes['ondblclick'].value}"
+
onfocus="#{buttonBean.attributes['onfocus'].value}"
onkeydown="#{buttonBean.attributes['onkeydown'].value}"
onkeypress="#{buttonBean.attributes['onkeypress'].value}"
onkeyup="#{buttonBean.attributes['onkeyup'].value}"
@@ -60,10 +66,14 @@
onmouseout="#{buttonBean.attributes['onmouseout'].value}"
onmouseover="#{buttonBean.attributes['onmouseover'].value}"
onmouseup="#{buttonBean.attributes['onmouseup'].value}"
-
render="#{buttonBean.attributes['render'].value}"
+
onselect="#{buttonBean.attributes['onselect'].value}"
+
readonly="#{buttonBean.attributes['readonly'].value}"
rendered="#{buttonBean.attributes['rendered'].value}"
style="#{buttonBean.attributes['style'].value}"
styleClass="#{buttonBean.attributes['styleClass'].value}"
+
tabindex="#{buttonBean.attributes['tabindex'].value}"
+
title="#{buttonBean.attributes['title'].value}"
+
type="#{buttonBean.attributes['type'].value}"
value="#{buttonBean.attributes['value'].value}"
execute="@form" />
</h:panelGrid>
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/hCommandButton/TestHCommandButton.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/hCommandButton/TestHCommandButton.java 2011-01-17
12:31:59 UTC (rev 21045)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/hCommandButton/TestHCommandButton.java 2011-01-17
12:58:47 UTC (rev 21046)
@@ -1,6 +1,6 @@
/*******************************************************************************
* JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
@@ -19,13 +19,10 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*******************************************************************************/
-
package org.richfaces.tests.metamer.ftest.hCommandButton;
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 java.net.URL;
@@ -90,6 +87,11 @@
}
@Test
+ public void testAccesskey() {
+ testHtmlAttribute(button, "accesskey", "b");
+ }
+
+ @Test
public void testAction() {
JQueryLocator doubleStringAction =
pjq("input[value=doubleStringAction]");
JQueryLocator first6CharsAction =
pjq("input[value=first6CharsAction]");
@@ -102,7 +104,7 @@
waitGui.until(textEquals.locator(output1).text("RichFaces 4"));
String output = selenium.getText(output2);
assertEquals(output, "RichFaces 4RichFaces 4",
- "output2 when 'RichFaces 4' in input and doubleStringAction
selected");
+ "output2 when 'RichFaces 4' in input and doubleStringAction
selected");
selenium.click(first6CharsAction);
selenium.waitForPageToLoad(TIMEOUT);
@@ -134,7 +136,7 @@
waitGui.until(textEquals.locator(output1).text("RichFaces 4"));
String output = selenium.getText(output3);
assertEquals(output, "RichFaces 4RichFaces 4",
- "output2 when 'RichFaces 4' in input and
doubleStringActionListener selected");
+ "output2 when 'RichFaces 4' in input and
doubleStringActionListener selected");
selenium.click(first6CharsActionListener);
selenium.waitForPageToLoad(TIMEOUT);
@@ -151,10 +153,15 @@
waitGui.until(textEquals.locator(output1).text("RichFaces 4ě"));
output = selenium.getText(output3);
assertEquals(output, "RICHFACES 4Ě",
- "output2 when 'RichFaces 4ě' in input and
toUpperCaseActionListener selected");
+ "output2 when 'RichFaces 4ě' in input and
toUpperCaseActionListener selected");
}
@Test
+ public void testAlt() {
+ testHtmlAttribute(button, "alt", "metamer");
+ }
+
+ @Test
public void testDisabled() {
JQueryLocator disabledChecbox =
pjq("input[type=radio][name$=disabledInput][value=true]");
AttributeLocator<?> disabledAttribute = button.getAttribute(new
Attribute("disabled"));
@@ -166,14 +173,12 @@
assertEquals(isDisabled.toLowerCase(), "disabled", "The value of
attribute disabled");
}
- // not implemented in Mojarra
- // @Test
+ @Test
public void testOnblur() {
testFireEvent(Event.BLUR, button);
}
- // not implemented in Mojarra
- // @Test
+ @Test
public void testOnchange() {
testFireEvent(Event.CHANGE, button);
}
@@ -188,8 +193,7 @@
testFireEvent(Event.DBLCLICK, button);
}
- // not implemented in Mojarra
- // @Test
+ @Test
public void testOnfocus() {
testFireEvent(Event.FOCUS, button);
}
@@ -235,37 +239,18 @@
}
@Test
- public void testStyleClass() {
-
- JQueryLocator wide = pjq("input[name$=styleClassInput][value=wide]");
- JQueryLocator big = pjq("input[name$=styleClassInput][value=big]");
- JQueryLocator none = pjq("input[name$=styleClassInput][value=]");
-
- final AttributeLocator<?> classAttribute = button.getAttribute(new
Attribute("class"));
-
- selenium.click(wide);
- selenium.waitForPageToLoad(TIMEOUT);
- assertTrue(selenium.belongsClass(button, "wide"), "Button's
class was not changed to 'wide'");
-
- selenium.click(big);
- selenium.waitForPageToLoad(TIMEOUT);
- assertTrue(selenium.belongsClass(button, "big"), "Button's
class was not changed to 'big'");
-
- selenium.click(none);
- selenium.waitForPageToLoad(TIMEOUT);
- assertFalse(selenium.isAttributePresent(classAttribute), "Button's class
was not removed.");
+ public void testStyle() {
+ testStyle(button, "style");
}
@Test
- public void testStyle() {
- JQueryLocator styleInput = pjq("input[id$=styleInput]");
- final AttributeLocator<?> attribute = button.getAttribute(new
Attribute("style"));
- final String value = "font-size: 20px;";
+ public void testStyleClass() {
+ testStyleClass(button, "styleClass");
+ }
- selenium.type(styleInput, value);
- selenium.waitForPageToLoad(TIMEOUT);
-
- assertEquals(selenium.getAttribute(attribute), value, "Style of the button
did not change");
+ @Test
+ public void testTitle() {
+ testTitle(button);
}
@Test
@@ -279,5 +264,4 @@
assertEquals(selenium.getAttribute(attribute), value, "Value of the button
did not change");
}
-
}