Author: dsvyatobatsko
Date: 2009-01-27 08:36:43 -0500 (Tue, 27 Jan 2009)
New Revision: 12435
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/InputNumberSpinnerBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inputNumberSpinner/inputNumberSpinnerAutoTest.xhtml
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/WEB-INF/faces-config.xml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inputNumberSpinner/inputNumberSpinnerTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InputNumberSpinnerTest.java
Log:
https://jira.jboss.org/jira/browse/RF-5892
https://jira.jboss.org/jira/browse/RF-5893
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/InputNumberSpinnerBean.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/InputNumberSpinnerBean.java
(rev 0)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/InputNumberSpinnerBean.java 2009-01-27
13:36:43 UTC (rev 12435)
@@ -0,0 +1,27 @@
+package org.ajax4jsf.bean;
+
+public class InputNumberSpinnerBean {
+
+ private Integer value = 20;
+
+ /**
+ * Gets value of value field.
+ * @return value of value field
+ */
+ public Integer getValue() {
+ return value;
+ }
+
+ /**
+ * Set a new value for value field.
+ * @param value a new value for value field
+ */
+ public void setValue(Integer value) {
+ this.value = value;
+ }
+
+ public void reset() {
+ this.value = 20;
+ }
+
+}
Property changes on:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/InputNumberSpinnerBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/WEB-INF/faces-config.xml 2009-01-26
19:39:21 UTC (rev 12434)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/WEB-INF/faces-config.xml 2009-01-27
13:36:43 UTC (rev 12435)
@@ -179,6 +179,11 @@
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
+ <managed-bean-name>spinnerBean</managed-bean-name>
+ <managed-bean-class>org.ajax4jsf.bean.InputNumberSpinnerBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
<managed-bean-name>a4jOutputPanelBean</managed-bean-name>
<managed-bean-class>org.ajax4jsf.bean.A4JOutputPanelTestBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inputNumberSpinner/inputNumberSpinnerAutoTest.xhtml
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inputNumberSpinner/inputNumberSpinnerAutoTest.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inputNumberSpinner/inputNumberSpinnerTest.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InputNumberSpinnerTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InputNumberSpinnerTest.java 2009-01-26
19:39:21 UTC (rev 12434)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InputNumberSpinnerTest.java 2009-01-27
13:36:43 UTC (rev 12435)
@@ -21,6 +21,7 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
+import org.richfaces.AutoTester;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
import org.testng.annotations.Test;
@@ -28,6 +29,10 @@
public class InputNumberSpinnerTest extends SeleniumTestBase {
+ private final static String RESET_METHOD = "#{spinnerBean.reset}";
+
+ private final static String FORM_ID = "autoTestForm:";
+
@Test
public void testInputNumberSpinnerComponent(Template template) {
renderPage(template);
@@ -61,22 +66,49 @@
Assert.assertEquals(getSpinnerValue(), "40");
}
+ @Test
+ public void testRenderedAttribute(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+ writeStatus("Test component with rendered = false is not present on the
page");
+ tester.testRendered();
+ }
+
+ @Test
+ public void testImmediate(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+ writeStatus("Test immediate attribute");
+ tester.testSubmitImmediate();
+ }
+
private void clickUp() {
- String id = getParentId() + "_form:" + "spinnerButtons";
+ String id = getParentId() + FORM_ID + "spinnerButtons";
selenium.fireEvent("xpath=//table[@id='" + id +
"']/tbody/tr[1]/td", "mousedown");
selenium.fireEvent("xpath=//table[@id='" + id +
"']/tbody/tr[1]/td", "mouseup");
}
private void clickDown() {
- String id = getParentId() + "_form:" + "spinnerButtons";
+ String id = getParentId() + FORM_ID + "spinnerButtons";
selenium.fireEvent("xpath=//table[@id='" + id +
"']/tbody/tr[2]/td", "mousedown");
selenium.fireEvent("xpath=//table[@id='" + id +
"']/tbody/tr[2]/td", "mouseup");
}
private String getSpinnerValue() {
- return selenium.getValue("name=" + getParentId() +
"_form:spinner");
+ return selenium.getValue("name=" + getParentId() + FORM_ID +
"spinner");
}
+ @Override
+ public void changeValue() {
+ clickUp();
+ }
+
+ @Override
+ public String getAutoTestUrl() {
+ return "pages/inputNumberSpinner/inputNumberSpinnerAutoTest.xhtml";
+ }
+
+ @Override
public String getTestUrl() {
return "pages/inputNumberSpinner/inputNumberSpinnerTest.xhtml";
}