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.

GridInDetailsRowTest.java 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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.GridCellElement;
  8. import com.vaadin.testbench.elements.GridElement.GridRowElement;
  9. import com.vaadin.tests.tb3.MultiBrowserTest;
  10. public class GridInDetailsRowTest extends MultiBrowserTest {
  11. @Test
  12. public void testNestedGridMultiRowHeaderPositions() {
  13. openTestURL();
  14. GridElement grid = $(GridElement.class).first();
  15. GridRowElement row = grid.getRow(2);
  16. row.doubleClick();
  17. waitForElementPresent(By.className("v-grid-spacer"));
  18. GridElement nestedGrid = $(GridElement.class).id("grid1");
  19. GridCellElement headerCell00 = nestedGrid.getHeaderCell(0, 0);
  20. GridCellElement headerCell11 = nestedGrid.getHeaderCell(1, 1);
  21. assertThat("Incorrect X-position.", headerCell11.getLocation().getX(),
  22. greaterThan(headerCell00.getLocation().getX()));
  23. assertThat("Incorrect Y-position.", headerCell11.getLocation().getY(),
  24. greaterThan(headerCell00.getLocation().getY()));
  25. }
  26. @Test
  27. public void testNestedGridRowHeights() {
  28. openTestURL();
  29. GridElement grid = $(GridElement.class).first();
  30. GridRowElement row = grid.getRow(2);
  31. row.doubleClick();
  32. waitForElementPresent(By.className("v-grid-spacer"));
  33. GridElement nestedGrid = $(GridElement.class).id("grid1");
  34. GridCellElement cell = nestedGrid.getCell(0, 0);
  35. assertThat("Incorrect row height.", cell.getSize().height,
  36. greaterThan(30));
  37. }
  38. }