Author: dsvyatobatsko
Date: 2009-02-24 13:59:11 -0500 (Tue, 24 Feb 2009)
New Revision: 12734
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/autotest/bean/AutoTestBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/autotest/autoTestControls.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inputNumberSlider/inputNumberSliderAutoTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/AutoTester.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InputNumberSliderTest.java
Log:
https://jira.jboss.org/jira/browse/RF-5856
https://jira.jboss.org/jira/browse/RF-5864
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/autotest/bean/AutoTestBean.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/autotest/bean/AutoTestBean.java 2009-02-24
18:12:08 UTC (rev 12733)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/autotest/bean/AutoTestBean.java 2009-02-24
18:59:11 UTC (rev 12734)
@@ -112,6 +112,8 @@
private boolean required;
+ private boolean disabled;
+
public class AutoTestConverter implements Converter {
public static final String AS_OBJECT_STRING =
"AUTO_TEST_CONVERTER_AS_OBJECT";
@@ -531,13 +533,29 @@
this.required = required;
}
- public boolean isProcessExternalValidationSet() {
- return processExternalValidationSet;
- }
+ /**
+ * Gets value of disabled field.
+ * @return value of disabled field
+ */
+ public boolean isDisabled() {
+ return disabled;
+ }
- public void setProcessExternalValidationSet(boolean processExternalValidationSet) {
- this.processExternalValidationSet = processExternalValidationSet;
- }
+ /**
+ * Set a new value for disabled field.
+ * @param disabled a new value for disabled field
+ */
+ public void setDisabled(boolean disabled) {
+ this.disabled = disabled;
+ }
+
+ public boolean isProcessExternalValidationSet() {
+ return processExternalValidationSet;
+ }
+
+ public void setProcessExternalValidationSet(boolean processExternalValidationSet) {
+ this.processExternalValidationSet = processExternalValidationSet;
+ }
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/autotest/autoTestControls.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/autotest/autoTestControls.xhtml 2009-02-24
18:12:08 UTC (rev 12733)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/autotest/autoTestControls.xhtml 2009-02-24
18:59:11 UTC (rev 12734)
@@ -79,7 +79,13 @@
</td>
</tr>
<tr>
+ <td>Disabled:</td>
<td>
+ <h:selectBooleanCheckbox id="_auto_disabled"
value="#{autoTestBean.disabled}"></h:selectBooleanCheckbox>
+ </td>
+ </tr>
+ <tr>
+ <td>
<h:commandButton id="_auto_load"
actionListener="#{templateBean.reset}" action="#{autoTestBean.load}"
value="Load"></h:commandButton>
</td>
<td>
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inputNumberSlider/inputNumberSliderAutoTest.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/AutoTester.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/AutoTester.java 2009-02-24
18:12:08 UTC (rev 12733)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/AutoTester.java 2009-02-24
18:59:11 UTC (rev 12734)
@@ -755,6 +755,14 @@
return true;
}
+ public void disableComponent(boolean disabled) {
+ reset();
+ if (disabled) {
+ setupControl(TestSetupEntry.disabled, Boolean.TRUE);
+ }
+ clickLoad();
+ }
+
private String getStatus() {
return base.getTextById(base.getParentId() + AUTOTEST_FORM_ID + STATUS_ID);
}
@@ -804,6 +812,8 @@
public static final TestSetupEntry required = new
TestSetupEntry("required", Boolean.class, Boolean.FALSE);
+ public static final TestSetupEntry disabled = new
TestSetupEntry("disabled", Boolean.class, Boolean.FALSE);
+
public static final List<TestSetupEntry> list = new
ArrayList<TestSetupEntry>();
static {
list.add(reRender);
@@ -818,6 +828,7 @@
list.add(process);
list.add(processExternalValidation);
list.add(required);
+ list.add(disabled);
}
}
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InputNumberSliderTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InputNumberSliderTest.java 2009-02-24
18:12:08 UTC (rev 12733)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InputNumberSliderTest.java 2009-02-24
18:59:11 UTC (rev 12734)
@@ -137,6 +137,25 @@
tester.testSubmitImmediate();
}
+ @Test
+ public void testValidatorAndValidatorMessageAttributes(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+ writeStatus("Check validator and validatorMessage attributes");
+ tester.testValidatorAndValidatorMessageAttributes(true);
+ }
+
+ @Test
+ public void testDisabledAttribute(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+ writeStatus("Check component can be disabled");
+
+ tester.disableComponent(true);
+ String inputId = getAutoTester(this).getClientId(AutoTester.COMPONENT_ID) +
"Input";
+ Assert.assertFalse(selenium.isEditable(inputId), "Slider's input has to
be read only");
+ }
+
private String getSliderValue() {
return selenium.getValue("name=" + getParentId() + FORM_ID +
"componentId");
}