Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

TextFieldValueGoesMissingTest.java 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Copyright 2000-2014 Vaadin Ltd.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy of
  6. * the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. * License for the specific language governing permissions and limitations under
  14. * the License.
  15. */
  16. package com.vaadin.tests.components.table;
  17. import org.junit.Assert;
  18. import org.junit.Test;
  19. import org.openqa.selenium.By;
  20. import org.openqa.selenium.interactions.Actions;
  21. import com.vaadin.testbench.elements.ButtonElement;
  22. import com.vaadin.testbench.elements.TextFieldElement;
  23. import com.vaadin.tests.tb3.MultiBrowserTest;
  24. /**
  25. * Tests that a text field's value isn't cleared after a label in the same
  26. * layout is changed.
  27. *
  28. * @since 7.3
  29. * @author Vaadin Ltd
  30. */
  31. public class TextFieldValueGoesMissingTest extends MultiBrowserTest {
  32. /* This test was rewritten from a TB2 test. */
  33. @Test
  34. public void valueMissingTest() throws Exception {
  35. openTestURL();
  36. waitForElementVisible(By.className("v-textfield"));
  37. TextFieldElement textfield = $(TextFieldElement.class).first();
  38. textfield.focus();
  39. textfield.sendKeys("test");
  40. $(ButtonElement.class).first().click();
  41. new Actions(getDriver()).contextClick(textfield).perform();
  42. Assert.assertEquals("test", textfield.getValue());
  43. }
  44. }