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.

CustomLayoutUpdateCaptionTest.java 860B

12345678910111213141516171819202122232425262728293031
  1. package com.vaadin.tests.components.customlayout;
  2. import static org.junit.Assert.assertEquals;
  3. import java.util.List;
  4. import org.junit.Test;
  5. import com.vaadin.testbench.elements.ButtonElement;
  6. import com.vaadin.testbench.elements.TextFieldElement;
  7. import com.vaadin.tests.tb3.SingleBrowserTest;
  8. public class CustomLayoutUpdateCaptionTest extends SingleBrowserTest {
  9. @Test
  10. public void captionUpdated() {
  11. openTestURL();
  12. List<TextFieldElement> tfs = $(TextFieldElement.class).all();
  13. TextFieldElement tf1 = tfs.get(0);
  14. TextFieldElement tf2 = tfs.get(1);
  15. assertEquals("initial", tf1.getCaption());
  16. assertEquals("initial", tf2.getCaption());
  17. $(ButtonElement.class).first().click();
  18. assertEquals("updated", tf1.getCaption());
  19. assertEquals("updated", tf2.getCaption());
  20. }
  21. }