Author: jjamrich
Date: 2011-11-24 07:57:24 -0500 (Thu, 24 Nov 2011)
New Revision: 22995
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/DataScroller.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/TestDataScrollerAttributes.java
Log:
RFPL-870: add dataScroller test for move one step
Add test for move forward by stepForward button 2 times, then move backward by stepBack
button 2 times.
Add clickNext and clickBack routine to dataScroller model.
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/DataScroller.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/DataScroller.java 2011-11-24
11:32:07 UTC (rev 22994)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/DataScroller.java 2011-11-24
12:57:24 UTC (rev 22995)
@@ -27,7 +27,6 @@
import org.jboss.test.selenium.framework.AjaxSelenium;
import org.jboss.test.selenium.framework.AjaxSeleniumProxy;
-import org.jboss.test.selenium.locator.Attribute;
import org.jboss.test.selenium.locator.JQueryLocator;
import org.jboss.test.selenium.locator.reference.ReferencedLocator;
import org.jboss.test.selenium.utils.text.SimplifiedFormat;
@@ -277,4 +276,12 @@
public void clickFastRewind() {
guardXhr(selenium).click(fastRewindButton);
}
+
+ public void clickStepForward() {
+ guardXhr(selenium).click(nextButton);
+ }
+
+ public void clickStepPrevious() {
+ guardXhr(selenium).click(previousButton);
+ }
}
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/TestDataScrollerAttributes.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/TestDataScrollerAttributes.java 2011-11-24
11:32:07 UTC (rev 22994)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/TestDataScrollerAttributes.java 2011-11-24
12:57:24 UTC (rev 22995)
@@ -247,7 +247,30 @@
assertFalse(getScroller().isPreviousButtonPresent(), "The previous button
shouldn't be present.");
}
+ /**
+ * Test simple step forward and step back buttons on dataScroller
+ */
@Test
+ public void testStep() {
+ retrieveRequestTime.initializeValue();
+ // 2 times move forward by basic step
+ getScroller().clickStepForward();
+ waitGui.waitForChange(retrieveRequestTime);
+ assertEquals(getScroller().getCurrentPage(), 2, "After clicking on the step
next button, the current page doesn't match.");
+ getScroller().clickStepForward();
+ waitGui.waitForChange(retrieveRequestTime);
+ assertEquals(getScroller().getCurrentPage(), 3, "After clicking on the step
next button, the current page doesn't match.");
+ // then move backward by basic step back
+ retrieveRequestTime.initializeValue();
+ getScroller().clickStepPrevious();
+ waitGui.waitForChange(retrieveRequestTime);
+ assertEquals(getScroller().getCurrentPage(), 2, "After clicking on the step
previous button, the current page doesn't match.");
+ getScroller().clickStepPrevious();
+ waitGui.waitForChange(retrieveRequestTime);
+ assertEquals(getScroller().getCurrentPage(), 1, "After clicking on the step
previous button, the current page doesn't match.");
+ }
+
+ @Test
public void testStyle() {
super.testStyle(getScroller());
}