Author: dsvyatobatsko
Date: 2009-01-30 08:08:33 -0500 (Fri, 30 Jan 2009)
New Revision: 12503
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inputNumberSpinner/inputNumberSpinnerAutoTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InputNumberSpinnerTest.java
Log:
https://jira.jboss.org/jira/browse/RF-5884
https://jira.jboss.org/jira/browse/RF-5885
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inputNumberSpinner/inputNumberSpinnerAutoTest.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2009-01-30
02:02:00 UTC (rev 12502)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2009-01-30
13:08:33 UTC (rev 12503)
@@ -570,18 +570,17 @@
/**
* Asserts DOM node text equals to text defined
*
- * @param id -
- * DOM element id
+ * @param locator -
+ * locator an element locator
* @param value -
* text defined
* @param message = message to be displayed in failure case
*/
- public void AssertTextEquals(String id, String value, String message) {
- String _v = getTextById(id);
+ public void AssertTextEquals(String locator, String value, String message) {
+ String _v = selenium.getText(locator);
Assert.assertEquals(_v, value, message);
}
-
/**
* Asserts DOM node text does not equal to text defined
*
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-30
02:02:00 UTC (rev 12502)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InputNumberSpinnerTest.java 2009-01-30
13:08:33 UTC (rev 12503)
@@ -41,6 +41,29 @@
private final static String CONTROL_FORM_ID = "control:";
@Test
+ public void testComponentIsPresentOnThePageAndShowsModelValue(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+ writeStatus("Component is present on the page and shows model value");
+
+ String spinnerId = tester.getClientId(AutoTester.COMPONENT_ID);
+ AssertPresentAndVisible(spinnerId, "Spinner is not rendered");
+ Assert.assertEquals(getSpinnerValue(), "20");
+ }
+
+ @Test
+ public void testValueChangeEventFiredAndModelUpdatedOnSubmit(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+ String submittedValueId = tester.getClientId("submittedValue");
+
+ writeStatus("Check ValueChangeListeners invoked on submit and model binding
is updated on value changed");
+ Assert.assertEquals(getSpinnerValue(), "20");
+ tester.testSubmit();
+ AssertTextEquals(submittedValueId, "30", "Model binding is not
updated on value changed");
+ }
+
+ @Test
public void testCycleMode(Template template) {
renderPage(template, RESET_METHOD);
writeStatus("Check cycled attribute");