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.

InitiallyDisabledGridTest.java 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package com.vaadin.tests.components.grid;
  2. import static org.junit.Assert.assertEquals;
  3. import static org.junit.Assert.assertTrue;
  4. import java.util.List;
  5. import org.junit.Test;
  6. import org.openqa.selenium.WebElement;
  7. import com.vaadin.testbench.By;
  8. import com.vaadin.testbench.elements.ButtonElement;
  9. import com.vaadin.testbench.elements.GridElement;
  10. import com.vaadin.testbench.elements.GridElement.GridCellElement;
  11. import com.vaadin.tests.tb3.SingleBrowserTest;
  12. public class InitiallyDisabledGridTest extends SingleBrowserTest {
  13. @Test
  14. public void columnsExpanded() {
  15. openTestURL();
  16. List<WebElement> cells = findElements(By.className("v-grid-cell"));
  17. WebElement col0 = cells.get(0);
  18. WebElement col1 = cells.get(1);
  19. assertTrue(col0.getSize().getWidth() > 250);
  20. assertTrue(col1.getSize().getWidth() > 250);
  21. }
  22. @Test
  23. public void worksWhenEnabled() {
  24. openTestURL();
  25. $(ButtonElement.class).first().click();
  26. GridElement grid = $(GridElement.class).first();
  27. grid.scrollToRow(80);
  28. GridCellElement col0 = grid.getCell(80, 0);
  29. assertEquals("First 80", col0.getText());
  30. }
  31. }