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 924B

12345678910111213141516171819202122232425262728293031323334
  1. package com.vaadin.tests.components.grid;
  2. import org.junit.Assert;
  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. Assert.assertTrue("Grid details don't exist", hasDetailsElement());
  19. $(ButtonElement.class).first().click();
  20. Assert.assertTrue("Grid details don't exist after deattach and reattach",hasDetailsElement() );
  21. }
  22. private final By locator = By.className("v-grid-spacer");
  23. private boolean hasDetailsElement() {
  24. return !findElements(locator).isEmpty();
  25. }
  26. }