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.

AccordionAddTabTest.java 880B

123456789101112131415161718192021222324252627282930313233343536
  1. package com.vaadin.tests.components.accordion;
  2. import static org.junit.Assert.assertEquals;
  3. import java.util.List;
  4. import org.junit.Test;
  5. import org.openqa.selenium.WebElement;
  6. import com.vaadin.testbench.By;
  7. import com.vaadin.tests.tb3.MultiBrowserTest;
  8. /**
  9. * Test for Accordion : replace widget in tab should remove old widget.
  10. *
  11. * @since 7.2
  12. * @author Vaadin Ltd
  13. */
  14. public class AccordionAddTabTest extends MultiBrowserTest {
  15. @Test
  16. public void testRemoveAndAdd() {
  17. openTestURL();
  18. WebElement button = driver.findElement(By.className("v-button"));
  19. button.click();
  20. List<WebElement> panels = driver.findElements(By.className("v-panel"));
  21. assertEquals(
  22. "Found two widgets inside one tab after "
  23. + "subsequent tab removal and addition",
  24. 1, panels.size());
  25. }
  26. }