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.

FontIconsTest.java 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package com.vaadin.tests.fonticon;
  2. import static org.junit.Assert.assertEquals;
  3. import java.io.IOException;
  4. import org.junit.Test;
  5. import org.openqa.selenium.Keys;
  6. import com.vaadin.testbench.elements.ComboBoxElement;
  7. import com.vaadin.tests.tb3.MultiBrowserTest;
  8. public class FontIconsTest extends MultiBrowserTest {
  9. @Test
  10. public void checkScreenshot() throws IOException {
  11. openTestURL();
  12. waitUntilLoadingIndicatorNotVisible();
  13. compareScreen("allVaadinIcons");
  14. }
  15. @Test
  16. public void comboBoxItemIconsOnKeyboardNavigation() throws Exception {
  17. openTestURL();
  18. ComboBoxElement comboBox = $(ComboBoxElement.class).first();
  19. // No initial value.
  20. assertEquals("", comboBox.getText());
  21. // Navigate to the first item with keyboard navigation.
  22. comboBox.sendKeys(400, Keys.ARROW_DOWN, Keys.ARROW_DOWN);
  23. // Value must be "One" without any extra characters.
  24. // See ticket #14660
  25. assertEquals("One", comboBox.getText());
  26. // Check also the second item.
  27. comboBox.sendKeys(Keys.ARROW_DOWN);
  28. assertEquals("Two", comboBox.getText());
  29. }
  30. }