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.

GridWithInitiallyOpenDetailsTest.java 1.1KB

12345678910111213141516171819202122232425262728293031323334
  1. package com.vaadin.tests.components.grid;
  2. import static org.hamcrest.Matchers.greaterThan;
  3. import static org.junit.Assert.assertThat;
  4. import org.junit.Test;
  5. import org.openqa.selenium.By;
  6. import com.vaadin.testbench.elements.GridElement;
  7. import com.vaadin.testbench.elements.GridElement.GridRowElement;
  8. import com.vaadin.tests.tb3.MultiBrowserTest;
  9. public class GridWithInitiallyOpenDetailsTest extends MultiBrowserTest {
  10. @Test
  11. public void testRowPositions() {
  12. openTestURL();
  13. GridElement grid = $(GridElement.class).first();
  14. GridRowElement row0 = grid.getRow(0);
  15. GridRowElement row1 = grid.getRow(1);
  16. GridRowElement row2 = grid.getRow(2);
  17. waitForElementPresent(By.className("v-grid-spacer"));
  18. assertThat("Incorrect Y-position for second row.",
  19. row1.getLocation().getY(), greaterThan(row0.getLocation().getY()
  20. + row0.getSize().height + 10));
  21. assertThat("Incorrect Y-position for third row.",
  22. row2.getLocation().getY(), greaterThan(row1.getLocation().getY()
  23. + row1.getSize().height + 10));
  24. }
  25. }