[richfaces-svn-commits] JBoss Rich Faces SVN: r12440 - in trunk/test-applications/seleniumTest/richfaces/src: test/java/org/richfaces and 1 other directories.
richfaces-svn-commits at lists.jboss.org
richfaces-svn-commits at lists.jboss.org
Tue Jan 27 11:03:25 EST 2009
Author: dsvyatobatsko
Date: 2009-01-27 11:03:24 -0500 (Tue, 27 Jan 2009)
New Revision: 12440
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inputNumberSpinner/inputNumberSpinnerAutoTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inputNumberSpinner/inputNumberSpinnerTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/AutoTester.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InputNumberSpinnerTest.java
Log:
https://jira.jboss.org/jira/browse/RF-5886
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inputNumberSpinner/inputNumberSpinnerAutoTest.xhtml
===================================================================
(Binary files differ)
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/AutoTester.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/AutoTester.java 2009-01-27 15:59:21 UTC (rev 12439)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/AutoTester.java 2009-01-27 16:03:24 UTC (rev 12440)
@@ -495,32 +495,41 @@
Assert.fail("Converter attribute does not work: getAsObject method failed of converter was not triggered. Expected component value: ["+AutoTestBean.AutoTestConverter.AS_OBJECT_STRING+"]. But was: ["+value+"]");
}
}
-
- public void testValidatorAndValidatorMessageAttributes() {
- setInternalValidation(true);
- clickLoad();
-
- changeValue();
- clickSubmit();
-
- String validatorMessage = getValidatorMessage();
- if (!"".equals(validatorMessage)) {
- Assert.fail("Validator attribute does not work. Validation failed, but should not.");
- }
-
- setInternalValidation(false);
- clickLoad();
-
- changeValue();
- clickSubmit();
-
- validatorMessage = getValidatorMessage();
- if ("".equals(validatorMessage)) {
- Assert.fail("Validator attribute does not work. Validation passed, should be failed.");
- }else if (!AutoTestBean.VALIDATOR_MESSAGE.equals(validatorMessage)) {
- Assert.fail("ValidatorMessage attribute does not work. ValidationMessage expected: [" + AutoTestBean.VALIDATOR_MESSAGE+"].But was [" + validatorMessage + "]");
- }
-
+
+ public void testValidatorAndValidatorMessageAttributes(boolean checkListener) {
+ reset();
+ setInternalValidation(true);
+ clickLoad();
+
+ changeValue();
+ clickSubmit();
+
+ String validatorMessage = getValidatorMessage();
+ if (!"".equals(validatorMessage)) {
+ Assert.fail("Validator attribute does not work. Validation failed, but should not.");
+ }
+
+ if (checkListener) {
+ checkValueChangeListener(true);
+ }
+
+ setInternalValidation(false);
+ clickLoad();
+
+ changeValue();
+ clickSubmit();
+
+ validatorMessage = getValidatorMessage();
+ if ("".equals(validatorMessage)) {
+ Assert.fail("Validator attribute does not work. Validation passed, should be failed.");
+ } else if (!AutoTestBean.VALIDATOR_MESSAGE.equals(validatorMessage)) {
+ Assert.fail("ValidatorMessage attribute does not work. ValidationMessage expected: ["
+ + AutoTestBean.VALIDATOR_MESSAGE + "].But was [" + validatorMessage + "]");
+ }
+
+ if (checkListener) {
+ checkValueChangeListener(false);
+ }
}
public void checkActionListener(boolean passed) {
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java 2009-01-27 15:59:21 UTC (rev 12439)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java 2009-01-27 16:03:24 UTC (rev 12440)
@@ -769,7 +769,7 @@
AutoTester tester = getAutoTester(this);
tester.renderPage(template, RESET_METHOD);
calendarId = tester.getClientId(AutoTester.COMPONENT_ID, template);
- tester.testValidatorAndValidatorMessageAttributes();
+ tester.testValidatorAndValidatorMessageAttributes(false);
}
@Test
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-27 15:59:21 UTC (rev 12439)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InputNumberSpinnerTest.java 2009-01-27 16:03:24 UTC (rev 12440)
@@ -82,20 +82,28 @@
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);
+ }
+
private void clickUp() {
- String id = getParentId() + FORM_ID + "spinnerButtons";
+ String id = getParentId() + FORM_ID + "componentIdButtons";
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_ID + "spinnerButtons";
+ String id = getParentId() + FORM_ID + "componentIdButtons";
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_ID + "spinner");
+ return selenium.getValue("name=" + getParentId() + FORM_ID + "componentId");
}
@Override
More information about the richfaces-svn-commits
mailing list