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.

GridDisallowUserSelectionTest.java 867B

12345678910111213141516171819202122232425262728293031323334353637
  1. package com.vaadin.tests.components.grid;
  2. import static org.junit.Assert.assertFalse;
  3. import org.junit.Test;
  4. import com.vaadin.testbench.elements.ButtonElement;
  5. import com.vaadin.testbench.elements.GridElement;
  6. import com.vaadin.tests.tb3.MultiBrowserTest;
  7. /**
  8. * @author Vaadin Ltd
  9. *
  10. */
  11. public class GridDisallowUserSelectionTest extends MultiBrowserTest {
  12. @Test
  13. public void checkSelection() {
  14. openTestURL();
  15. assertNoSelection(0);
  16. assertNoSelection(1);
  17. // change model from single select to mutli
  18. $(ButtonElement.class).first().click();
  19. assertNoSelection(0);
  20. assertNoSelection(1);
  21. }
  22. private void assertNoSelection(int index) {
  23. GridElement grid = $(GridElement.class).first();
  24. grid.getCell(index, 0).click();
  25. assertFalse(grid.getRow(0).isSelected());
  26. }
  27. }