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.

TextFieldValueGoesMissingTest.java 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package com.vaadin.tests.components.table;
  2. import static org.junit.Assert.assertEquals;
  3. import org.junit.Test;
  4. import org.openqa.selenium.By;
  5. import org.openqa.selenium.interactions.Actions;
  6. import com.vaadin.testbench.elements.ButtonElement;
  7. import com.vaadin.testbench.elements.TextFieldElement;
  8. import com.vaadin.tests.tb3.MultiBrowserTest;
  9. /**
  10. * Tests that a text field's value isn't cleared after a label in the same
  11. * layout is changed.
  12. *
  13. * @since 7.3
  14. * @author Vaadin Ltd
  15. */
  16. public class TextFieldValueGoesMissingTest extends MultiBrowserTest {
  17. /* This test was rewritten from a TB2 test. */
  18. @Test
  19. public void valueMissingTest() throws Exception {
  20. openTestURL();
  21. waitForElementVisible(By.className("v-textfield"));
  22. TextFieldElement textfield = $(TextFieldElement.class).first();
  23. textfield.focus();
  24. textfield.sendKeys("test");
  25. $(ButtonElement.class).first().click();
  26. new Actions(getDriver()).contextClick(textfield).perform();
  27. assertEquals("test", textfield.getValue());
  28. }
  29. }