Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

TableWidthItemRemoveTest.java 932B

1234567891011121314151617181920212223242526272829303132
  1. package com.vaadin.tests.components.table;
  2. import static org.junit.Assert.assertTrue;
  3. import org.junit.Test;
  4. import org.openqa.selenium.WebElement;
  5. import com.vaadin.testbench.By;
  6. import com.vaadin.tests.tb3.MultiBrowserTest;
  7. /**
  8. * Test whether adding the first item to a table calculates the table width
  9. * correctly
  10. *
  11. * @author Vaadin Ltd
  12. */
  13. public class TableWidthItemRemoveTest extends MultiBrowserTest {
  14. @Test
  15. public void testWidthResizeOnItemAdd() {
  16. openTestURL();
  17. WebElement populateButton = driver
  18. .findElement(By.vaadin("//Button[caption=\"Populate\"]"));
  19. WebElement table = driver
  20. .findElement(By.vaadin("//Table[caption=\"My table\"]"));
  21. int original_width = table.getSize().getWidth();
  22. populateButton.click();
  23. assertTrue("Width changed on item add.",
  24. original_width == table.getSize().getWidth());
  25. }
  26. }