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.

TableSetUndefinedSizeTest.java 1.2KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package com.vaadin.tests.components.table;
  2. import org.junit.Test;
  3. import org.openqa.selenium.WebDriver;
  4. import org.openqa.selenium.support.ui.ExpectedCondition;
  5. import com.vaadin.testbench.elements.TableElement;
  6. import com.vaadin.testbench.elements.ButtonElement;
  7. import com.vaadin.tests.tb3.MultiBrowserTest;
  8. public class TableSetUndefinedSizeTest extends MultiBrowserTest {
  9. @Test
  10. public void testTableShouldChangeSizeIfWidthSetToUndefined() {
  11. openTestURL();
  12. $(ButtonElement.class).caption("width 500px").first().click();
  13. final TableElement table = $(TableElement.class).first();
  14. final int previousWidth = table.getSize().getWidth();
  15. $(ButtonElement.class).caption("undefined width").first().click();
  16. waitUntil(new ExpectedCondition<Boolean>() {
  17. @Override
  18. public Boolean apply(WebDriver input) {
  19. return previousWidth != table.getSize().getWidth();
  20. }
  21. @Override
  22. public String toString() {
  23. // Timed out after 10 seconds waiting for ...
  24. return "table to change size (was: " + previousWidth + ")";
  25. }
  26. });
  27. }
  28. }