Author: dsvyatobatsko
Date: 2008-07-24 09:57:45 -0400 (Thu, 24 Jul 2008)
New Revision: 9767
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InplaceInputTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InplaceSelectTest.java
Log:
inplaceInput/Select tests are fixed and extended
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InplaceInputTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InplaceInputTest.java 2008-07-24
13:56:35 UTC (rev 9766)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InplaceInputTest.java 2008-07-24
13:57:45 UTC (rev 9767)
@@ -76,7 +76,7 @@
writeStatus("Stop editing second component being tested");
- selenium.fireEvent(inplaceInputDOk, "mousedown");
+ selenium.mouseDown(inplaceInputDOk);
AssertTextEquals(inplaceInputD + "_view",
EVENT_TEST_RESULT_PASSED_TEXT, "onviewactivated event is not fired");
}
@@ -104,6 +104,40 @@
AssertVisible(inplaceInputDInput);
}
+ @Test
+ public void testInplaceInputComponentCore(Template template) {
+ renderPage(template);
+
+ String inplaceInputD = getParentId() + "_form:" +
INPLACE_INPUT_DECORATED;
+ String inplaceInputDInput = inplaceInputD + INPLACE_INPUT_FIELD_POSTFIX;
+ String inplaceInputDOk = getParentId() + "_form:" +
INPLACE_INPUT_DECORATED_OK;
+ String inplaceInputDCancel = getParentId() + "_form:" +
INPLACE_INPUT_DECORATED_CANCEL;
+
+ writeStatus("Check component's core functionality");
+
+ writeStatus("Double-click the second component and type an initial
text");
+ selenium.doubleClick(inplaceInputD);
+ type(inplaceInputDInput, "Sun");
+
+ writeStatus("Stop editing with ok. The input has to be saved");
+ selenium.mouseDown(inplaceInputDOk);
+ String sun = invokeFromComponent(inplaceInputD, "getValue", null);
+ Assert.assertEquals(sun, "Sun", "An inputted text has not been
saved with ok");
+ //AssertTextEquals(inplaceInputD, "Sun", "An inputted text has not
been saved with ok");
+
+ writeStatus("Double-click the second component again and type a new
text");
+ selenium.doubleClick(inplaceInputD);
+ type(inplaceInputDInput, "Sky");
+
+ writeStatus("Stop editing with cancel. The input has not to be
saved");
+ selenium.mouseDown(inplaceInputDCancel);
+
+ sun = invokeFromComponent(inplaceInputD, "getValue", null);
+ Assert.assertEquals(sun, "Sun", "An inputted text has not to be
saved with cancel");
+ //AssertTextEquals(inplaceInputD, "Sun", "An inputted text has not
to be saved with cancel");
+
+ }
+
@Override
public String getTestUrl() {
return "pages/inplaceInput/inplaceInputTest.xhtml";
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InplaceSelectTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InplaceSelectTest.java 2008-07-24
13:56:35 UTC (rev 9766)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InplaceSelectTest.java 2008-07-24
13:57:45 UTC (rev 9767)
@@ -36,7 +36,7 @@
writeStatus("Select second element"); //Birch
selenium.mouseMove("xpath=//div[@id='list" + inplaceSelectId +
"']/span[2]");
- selenium.fireEvent(okButton, "mousedown");
+ selenium.mouseDown(okButton);
writeStatus("Check that a new element is selected");
@@ -47,7 +47,7 @@
selenium.doubleClick(inplaceSelectId);
selenium.mouseMove("xpath=//div[@id='list" + inplaceSelectId +
"']/span[3]");
- selenium.fireEvent(cancelButton, "mousedown");
+ selenium.mouseDown(cancelButton);
writeStatus("Cancel selected value.");
AssertValueEquals(inplaceSelectId + "inplaceValue", "Birch",
"A value has not to be changed");
@@ -62,11 +62,11 @@
Assert.assertEquals(runScript("theLatestEvent"),
"editactivated", "editactivated event has not been triggered");
writeStatus("Stop editing with ok");
- selenium.fireEvent(okButton, "mousedown");
+ selenium.mouseDown(okButton);
Assert.assertEquals(runScript("theLatestEvent"),
"viewactivated", "viewactivated event has not been triggered");
writeStatus("Stop editing with cancel");
- selenium.fireEvent(cancelButton, "mousedown");
+ selenium.mouseDown(cancelButton);
Assert.assertEquals(runScript("theLatestEvent"),
"viewactivated", "viewactivated event has not been triggered");
}
Show replies by date