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.

GridDetailsReattachTest.java 944B

123456789101112131415161718192021222324252627282930313233343536
  1. package com.vaadin.tests.components.grid;
  2. import static org.junit.Assert.assertTrue;
  3. import org.junit.Before;
  4. import org.junit.Test;
  5. import org.openqa.selenium.By;
  6. import com.vaadin.testbench.elements.ButtonElement;
  7. import com.vaadin.testbench.parallel.TestCategory;
  8. import com.vaadin.tests.tb3.MultiBrowserTest;
  9. @TestCategory("grid")
  10. public class GridDetailsReattachTest extends MultiBrowserTest {
  11. @Before
  12. public void setUp() {
  13. setDebug(true);
  14. }
  15. @Test
  16. public void clickToAddCaption() {
  17. openTestURL();
  18. assertTrue("Grid details don't exist", hasDetailsElement());
  19. $(ButtonElement.class).first().click();
  20. assertTrue("Grid details don't exist after deattach and reattach",
  21. hasDetailsElement());
  22. }
  23. private final By locator = By.className("v-grid-spacer");
  24. private boolean hasDetailsElement() {
  25. return !findElements(locator).isEmpty();
  26. }
  27. }