Author: konstantin.mishin
Date: 2008-11-24 10:48:58 -0500 (Mon, 24 Nov 2008)
New Revision: 11327
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ListShuttleTest.java
Log:
RF-4719
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ListShuttleTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ListShuttleTest.java 2008-11-24
15:23:28 UTC (rev 11326)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ListShuttleTest.java 2008-11-24
15:48:58 UTC (rev 11327)
@@ -304,17 +304,18 @@
/**
* JS API is present and works
*/
-// @Test
+ @Test
public void testJSAPI(Template template) {
- //TODO JS API has some bugs. This test case should be completed after fixing
theirs.
init(template);
selenium.runScript("var listShuttle = ($('" + lsId +
"')).component;");
+ checkJSError();
// Check count
_assertTableRowsCount(availebleListId, 5);
_assertTableRowsCount(targetListId, 0);
// Copy all and check count
try {
selenium.runScript("listShuttle.copyAll();");
+ checkJSError();
_assertTableRowsCount(availebleListId, 0);
_assertTableRowsCount(targetListId, 5);
} catch (Exception e) {
@@ -325,6 +326,7 @@
// Remove all and check count
try {
selenium.runScript("listShuttle.removeAll();");
+ checkJSError();
_assertTableRowsCount(availebleListId, 5);
_assertTableRowsCount(targetListId, 0);
} catch (Exception e) {
@@ -336,10 +338,13 @@
// Copy 1st & 2nd item
_selectItem(parentId + "ls:0");
selenium.runScript("listShuttle.copy();");
+ checkJSError();
_selectItem(parentId + "ls:1");
selenium.runScript("listShuttle.copy();");
+ checkJSError();
_selectItem(parentId + "ls:2");
selenium.runScript("listShuttle.copy();");
+ checkJSError();
// Check count
_assertTableRowsCount(availebleListId, 2);
_assertTableRowsCount(targetListId, 3);
@@ -357,22 +362,27 @@
// Move the first to to the last
_selectItem(parentId + "ls:t0");
selenium.runScript("listShuttle.down();");
+ checkJSError();
_checkOrdering(targetListId, "2Item2", "1Item1",
"3Item3", "Test failed. Down control does not work");
_selectItem(parentId + "ls:t0");
selenium.runScript("listShuttle.bottom();");
+ checkJSError();
_checkOrdering(targetListId, "2Item2", "3Item3",
"1Item1", "Test failed. Last control does not work");
_selectItem(parentId + "ls:t2");
selenium.runScript("listShuttle.top();");
+ checkJSError();
_checkOrdering(targetListId, "3Item3", "2Item2",
"1Item1", "Test failed. First control does not work");
_selectItem(parentId + "ls:t0");
selenium.runScript("listShuttle.up();");
+ checkJSError();
_checkOrdering(targetListId, "3Item3", "1Item1",
"2Item2", "Test failed. Up control does not work");
_selectItem(parentId + "ls:t1");
selenium.runScript("listShuttle.remove();");
+ checkJSError();
_checkOrdering(targetListId, "3Item3", "1Item1", null,
"Test failed. Remove control does not work");
_assertTableRowsCount(targetListId, 2);
Show replies by date