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.

GridAssistiveCaptionTest.java 1.1KB

12345678910111213141516171819202122232425262728293031323334
  1. package com.vaadin.tests.components.grid;
  2. import static org.junit.Assert.assertNull;
  3. import static org.junit.Assert.assertTrue;
  4. import org.junit.Test;
  5. import com.vaadin.testbench.elements.ButtonElement;
  6. import com.vaadin.testbench.elements.GridElement;
  7. import com.vaadin.tests.tb3.SingleBrowserTest;
  8. public class GridAssistiveCaptionTest extends SingleBrowserTest {
  9. @Test
  10. public void checkGridAriaLabel() {
  11. openTestURL();
  12. GridElement.GridCellElement headerCell = $(GridElement.class).first()
  13. .getHeaderCell(0, 0);
  14. // default grid has no aria-label
  15. assertNull("Column should not contain aria-label",
  16. headerCell.getAttribute("aria-label"));
  17. $(ButtonElement.class).caption("addAssistiveCaption").first().click();
  18. assertTrue("Column should contain aria-label", headerCell
  19. .getAttribute("aria-label").equals("Press Enter to sort."));
  20. $(ButtonElement.class).caption("removeAssistiveCaption").first()
  21. .click();
  22. assertNull("Column should not contain aria-label",
  23. headerCell.getAttribute("aria-label"));
  24. }
  25. }