Author: dsvyatobatsko
Date: 2008-08-07 09:11:30 -0400 (Thu, 07 Aug 2008)
New Revision: 9972
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBase.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/DataTableTest.java
Log:
moved two useful methods from DataTableTest to base class
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBase.java 2008-08-07
12:44:41 UTC (rev 9971)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBase.java 2008-08-07
13:11:30 UTC (rev 9972)
@@ -794,6 +794,34 @@
}
/**
+ * Asserts that expected columns count equals actual one.
+ * @param i the expected columns count
+ * @param tableId id of table to be checked
+ */
+ public void assertColumnsCount(int i, String tableId) {
+ StringBuffer script = new StringBuffer("$('");
+ script.append(tableId);
+ script.append("').rows[0].cells.length");
+
+ String count = runScript(script.toString());
+ Assert.assertEquals(count, String.valueOf(i));
+ }
+
+ /**
+ * Asserts that expected rows count equals actual one.
+ * @param i the expected rows count
+ * @param tableId id of table to be checked
+ */
+ public void assertRowsCount(int i, String tableId) {
+ StringBuffer script = new StringBuffer("$('");
+ script.append(tableId);
+ script.append("').rows.length");
+
+ String count = runScript(script.toString());
+ Assert.assertEquals(count, String.valueOf(i));
+ }
+
+ /**
* Checks whether client is FireFox
*
* @return true if client is FireFox
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/DataTableTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/DataTableTest.java 2008-08-07
12:44:41 UTC (rev 9971)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/DataTableTest.java 2008-08-07
13:11:30 UTC (rev 9972)
@@ -1,7 +1,5 @@
package org.richfaces.testng;
-import javax.faces.event.ActionEvent;
-
import org.ajax4jsf.template.Template;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
@@ -188,22 +186,4 @@
Assert.assertEquals(runScript(script), value);
}
- private void assertColumnsCount(int i, String tableId) {
- StringBuffer script = new StringBuffer("$('");
- script.append(tableId);
- script.append("').rows[0].cells.length");
-
- String count = runScript(script.toString());
- Assert.assertEquals(count, String.valueOf(i));
- }
-
- private void assertRowsCount(int i, String tableId) {
- StringBuffer script = new StringBuffer("$('");
- script.append(tableId);
- script.append("').rows.length");
-
- String count = runScript(script.toString());
- Assert.assertEquals(count, String.valueOf(i));
- }
-
}
Show replies by date