diff options
Diffstat (limited to 'uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java')
-rw-r--r-- | uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java | 21 |
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 { |