Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

TableRemovedQuicklySendsInvalidRpcCallsTest.java 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 static org.junit.Assert.assertFalse;
  18. import static org.junit.Assert.assertTrue;
  19. import org.junit.Test;
  20. import org.openqa.selenium.WebElement;
  21. import com.vaadin.tests.tb3.MultiBrowserTest;
  22. public class TableRemovedQuicklySendsInvalidRpcCallsTest extends
  23. MultiBrowserTest {
  24. private static final String BUTTON_ID = TableRemovedQuicklySendsInvalidRpcCalls.BUTTON_ID;
  25. private static final String FAILURE_CAPTION = TableRemovedQuicklySendsInvalidRpcCalls.FAILURE_CAPTION;
  26. private static final String SUCCESS_CAPTION = TableRemovedQuicklySendsInvalidRpcCalls.SUCCESS_CAPTION;
  27. @Test
  28. public void test() throws Exception {
  29. setDebug(true);
  30. openTestURL();
  31. assertFalse("Test started with the error present.", button().getText()
  32. .equals(FAILURE_CAPTION));
  33. assertFalse("Test jumped the gun.",
  34. button().getText().equals(SUCCESS_CAPTION));
  35. button().click();
  36. Thread.sleep(5000);
  37. assertFalse("Test failed after trying to trigger the error.", button()
  38. .getText().equals(FAILURE_CAPTION));
  39. assertTrue("Test didn't end up in correct success state.", button()
  40. .getText().equals(SUCCESS_CAPTION));
  41. }
  42. private WebElement button() {
  43. return vaadinElementById(BUTTON_ID);
  44. }
  45. }