Author: lfryc(a)redhat.com
Date: 2010-07-10 17:00:30 -0400 (Sat, 10 Jul 2010)
New Revision: 17886
Modified:
root/tests/metamer/trunk/ftest/test-source/src/main/java/org/richfaces/tests/testapp/richExtendedDataTable/ScrollerTestCase.java
Log:
fixed locators bound to elements id for tests inside containers
Modified:
root/tests/metamer/trunk/ftest/test-source/src/main/java/org/richfaces/tests/testapp/richExtendedDataTable/ScrollerTestCase.java
===================================================================
---
root/tests/metamer/trunk/ftest/test-source/src/main/java/org/richfaces/tests/testapp/richExtendedDataTable/ScrollerTestCase.java 2010-07-10
21:00:03 UTC (rev 17885)
+++
root/tests/metamer/trunk/ftest/test-source/src/main/java/org/richfaces/tests/testapp/richExtendedDataTable/ScrollerTestCase.java 2010-07-10
21:00:30 UTC (rev 17886)
@@ -23,14 +23,14 @@
package org.richfaces.tests.testapp.richExtendedDataTable;
import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardHttp;
-import static org.jboss.test.selenium.locator.LocatorFactory.jq;
+import static org.jboss.test.selenium.locator.LocatorFactory.*;
import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
import static org.testng.Assert.assertEquals;
import java.net.URL;
import org.jboss.test.selenium.dom.Event;
-import org.jboss.test.selenium.locator.JQueryLocator;
+import org.jboss.test.selenium.locator.ElementLocator;
import org.richfaces.tests.testapp.AbstractTestappTestCase;
import org.testng.annotations.Test;
@@ -42,10 +42,10 @@
*/
public class ScrollerTestCase extends AbstractTestappTestCase {
- DataScroller dataScroller1 = new
DataScroller(jq("#form\\:richEDT\\:scroller2"));
- DataScroller dataScroller2 = new DataScroller(jq("#form\\:scroller1"));
- DataTable table = new DataTable(jq("#form\\:richEDT"));
- JQueryLocator attributeRowsInput = jq("#form\\:attributes\\:rowsInput");
+ DataScroller dataScroller1 = new
DataScroller(pjq("span.rf-ds[id$=scroller1]"));
+ DataScroller dataScroller2 = new
DataScroller(pjq("span.rf-ds[id$=scroller2]"));
+ DataTable table = new DataTable(pjq("table.rf-dt[id$=richEDT]"));
+ ElementLocator attributeRowsInput = id("form:attributes:rowsInput");
@Override
public URL getTestUrl() {
@@ -55,17 +55,18 @@
final static int TOTAL_ROW_COUNT = 50;
@Test(dataProvider = "templates")
- public void testDefaultDataScrollerRowCount(String templates) {
- testRowCount(dataScroller1);
+ public void testInternalDataScrollerRowCount(String templates) {
+ testRowCount(dataScroller2);
}
@Test(dataProvider = "templates")
public void testExternalDataScrollerRowCount(String templates) {
- testRowCount(dataScroller2);
+ testRowCount(dataScroller1);
}
private void testRowCount(DataScroller dataScroller) {
- for (Integer rowsPerPage : new Integer[]{null, 10, 1, TOTAL_ROW_COUNT, 13, 9, 17,
TOTAL_ROW_COUNT + 1, 2 * TOTAL_ROW_COUNT}) {
+ for (Integer rowsPerPage : new Integer[]{null, 10, 1, TOTAL_ROW_COUNT, 13, 9, 17,
TOTAL_ROW_COUNT + 1,
+ 2 * TOTAL_ROW_COUNT}) {
if (rowsPerPage != null) {
selenium.type(attributeRowsInput, String.valueOf(rowsPerPage));
guardHttp(selenium).fireEvent(attributeRowsInput, Event.BLUR);