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.

TreeTableScrollOnExpandTest.java 1007B

12345678910111213141516171819202122232425262728293031
  1. package com.vaadin.tests.components.treetable;
  2. import static org.junit.Assert.assertEquals;
  3. import java.io.IOException;
  4. import org.junit.Test;
  5. import org.openqa.selenium.By;
  6. import org.openqa.selenium.WebElement;
  7. import com.vaadin.testbench.elements.TreeTableElement;
  8. import com.vaadin.tests.tb3.MultiBrowserTest;
  9. public class TreeTableScrollOnExpandTest extends MultiBrowserTest {
  10. @Test
  11. public void testScrollOnExpand() throws InterruptedException, IOException {
  12. openTestURL();
  13. TreeTableElement tt = $(TreeTableElement.class).first();
  14. tt.getRow(0).click();
  15. tt.scroll(300);
  16. sleep(1000);
  17. tt.getRow(20).toggleExpanded();
  18. // Need to wait a bit to avoid accepting the case where the TreeTable is
  19. // in the desired state only for a short while.
  20. sleep(1000);
  21. WebElement focusedRow = getDriver()
  22. .findElement(By.className("v-table-focus"));
  23. assertEquals("Item 21", focusedRow.getText());
  24. }
  25. }