aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/tb3
diff options
context:
space:
mode:
authorSauli Tähkäpää <sauli@vaadin.com>2014-09-12 16:10:48 +0300
committerSauli Tähkäpää <sauli@vaadin.com>2014-09-19 06:07:40 +0000
commit588b52dfbe4823ac6d752bafece7e2aa0870960c (patch)
tree43bae907174d825ebdc7bfc7604e030b3cf4b9a7 /uitest/src/com/vaadin/tests/tb3
parent3bbf16e22860452d6fd34ccc127b42a3a2baac04 (diff)
downloadvaadin-framework-588b52dfbe4823ac6d752bafece7e2aa0870960c.tar.gz
vaadin-framework-588b52dfbe4823ac6d752bafece7e2aa0870960c.zip
Convert TableScrollsOnSelectionTest to TB4.
Change-Id: I27b8edbd0761771054dc4e1b0b6b2559957da0c6
Diffstat (limited to 'uitest/src/com/vaadin/tests/tb3')
-rw-r--r--uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java
index 8e6370a6fd..1d03a7df76 100644
--- a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java
+++ b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java
@@ -30,7 +30,9 @@ import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
+import java.util.NoSuchElementException;
+import com.vaadin.testbench.elements.TableElement;
import org.apache.commons.io.IOUtils;
import org.apache.http.HttpHost;
import org.apache.http.HttpResponse;
@@ -245,6 +247,25 @@ public abstract class AbstractTB3Test extends TestBenchTestCase {
.click();
}
+ protected void waitUntilRowIsVisible(final TableElement table, final int row) {
+ waitUntil(new ExpectedCondition<Object>() {
+ @Override
+ public Object apply(WebDriver input) {
+ try {
+ return table.getCell(row, 0) != null;
+ } catch (NoSuchElementException e) {
+ return false;
+ }
+ }
+ });
+ }
+
+ protected void scrollTable(TableElement table, int rows, int rowToWait) {
+ testBenchElement(table.findElement(By.className("v-scrollable"))).scroll(rows * 30);
+
+ waitUntilRowIsVisible(table, rowToWait);
+ }
+
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface RunLocally {