You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

TableCacheMinimizingOnFetchRowsTest.java 930B

123456789101112131415161718192021222324252627282930313233
  1. package com.vaadin.tests.components.table;
  2. import static org.hamcrest.MatcherAssert.assertThat;
  3. import org.junit.Test;
  4. import org.openqa.selenium.By;
  5. import com.vaadin.testbench.elements.ButtonElement;
  6. import com.vaadin.tests.tb3.MultiBrowserTest;
  7. public class TableCacheMinimizingOnFetchRowsTest extends MultiBrowserTest {
  8. @Test
  9. public void testCacheSize() throws InterruptedException {
  10. openTestURL();
  11. scrollToBottomOfTable();
  12. // the row request might vary slightly with different browsers
  13. String logtext1 = "requested 60 rows";
  14. String logtext2 = "requested 61 rows";
  15. assertThat("Requested cached rows did not match expected",
  16. logContainsText(logtext1) || logContainsText(logtext2));
  17. }
  18. private void scrollToBottomOfTable() {
  19. waitForElementPresent(By.className("v-button"));
  20. $(ButtonElement.class).first().click();
  21. }
  22. }