Author: lfryc(a)redhat.com
Date: 2010-07-21 08:14:03 -0400 (Wed, 21 Jul 2010)
New Revision: 18169
Modified:
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/DataTable.java
Log:
DataTable refactored to locator reference pattern
Modified:
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/DataTable.java
===================================================================
---
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/DataTable.java 2010-07-21
12:13:19 UTC (rev 18168)
+++
root/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/DataTable.java 2010-07-21
12:14:03 UTC (rev 18169)
@@ -24,8 +24,10 @@
import org.jboss.test.selenium.framework.AjaxSelenium;
import org.jboss.test.selenium.framework.AjaxSeleniumProxy;
import org.jboss.test.selenium.locator.JQueryLocator;
+import org.jboss.test.selenium.locator.reference.LocatorReference;
+import org.jboss.test.selenium.locator.reference.ReferencedLocator;
-import static org.jboss.test.selenium.locator.LocatorFactory.*;
+import static org.jboss.test.selenium.locator.reference.ReferencedLocator.*;
/**
* @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
@@ -33,21 +35,21 @@
*/
public class DataTable {
- AjaxSelenium selenium = AjaxSeleniumProxy.getInstance();
- JQueryLocator tableRoot;
- JQueryLocator tableRows = jq("div.rf-edt-b table table tr");
+ AjaxSelenium selenium = AjaxSeleniumProxy.getInstance();
- public DataTable(JQueryLocator tableRoot) {
- super();
- this.tableRoot = tableRoot;
- }
+ LocatorReference<JQueryLocator> root = new
LocatorReference<JQueryLocator>(null);
+ ReferencedLocator<JQueryLocator> tableRows = ref(root,
+ "> div.rf-edt-b table table tr");
- public int getCountOfTableRows() {
- JQueryLocator locator = tableRoot.getDescendant(tableRows);
- return selenium.getCount(locator);
- }
+ public DataTable(JQueryLocator tableRoot) {
+ root.setLocator(tableRoot);
+ }
- public String getTableText() {
- return selenium.getText(tableRoot);
- }
+ public int getCountOfTableRows() {
+ return selenium.getCount(tableRows);
+ }
+
+ public String getTableText() {
+ return selenium.getText(root.getLocator());
+ }
}
Show replies by date