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.

DateFieldNavigationKeyBoardTest.java 1.2KB

123456789101112131415161718192021222324252627282930313233
  1. package com.vaadin.tests.components.datefield;
  2. import static org.junit.Assert.assertNotEquals;
  3. import org.junit.Test;
  4. import org.openqa.selenium.By;
  5. import org.openqa.selenium.Keys;
  6. import org.openqa.selenium.WebElement;
  7. import com.vaadin.tests.tb3.MultiBrowserTest;
  8. public class DateFieldNavigationKeyBoardTest extends MultiBrowserTest {
  9. @Test
  10. public void testNavigation() {
  11. openTestURL();
  12. // Opening pop-up
  13. findElement(By.className("v-datefield-button")).click();
  14. waitForElementVisible(By.className("v-datefield-calendarpanel"));
  15. waitForElementPresent(
  16. By.className("v-datefield-calendarpanel-day-focused"));
  17. // Focused element in the calendarPanel
  18. WebElement focused = findElement(
  19. By.className("v-datefield-calendarpanel-day-focused"));
  20. // Value in it
  21. String dayValue = focused.getText();
  22. findElement(By.className("v-datefield-calendarpanel"))
  23. .sendKeys(Keys.ARROW_LEFT);
  24. assertNotEquals(dayValue,
  25. findElement(
  26. By.className("v-datefield-calendarpanel-day-focused"))
  27. .getText());
  28. }
  29. }