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.

GridSelectAllStatusTest.java 1.2KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package com.vaadin.tests.components.grid;
  2. import static org.junit.Assert.assertFalse;
  3. import static org.junit.Assert.assertTrue;
  4. import org.junit.Test;
  5. import org.openqa.selenium.WebElement;
  6. import com.vaadin.testbench.By;
  7. import com.vaadin.testbench.elements.GridElement;
  8. import com.vaadin.testbench.elements.LabelElement;
  9. import com.vaadin.tests.tb3.MultiBrowserTest;
  10. public class GridSelectAllStatusTest extends MultiBrowserTest {
  11. @Test
  12. public void checkSelectAllStatus() {
  13. openTestURL();
  14. GridElement grid = $(GridElement.class).first();
  15. LabelElement selectAllStatusLabel = $(LabelElement.class).id("status");
  16. WebElement selectAllCheckbox = grid
  17. .findElement(By.className("v-grid-select-all-checkbox"));
  18. // select all
  19. selectAllCheckbox.click();
  20. assertTrue(
  21. "The status of the select-all checkbox is expected to be True.",
  22. Boolean.parseBoolean(selectAllStatusLabel.getText()));
  23. // De-select all selections
  24. selectAllCheckbox.click();
  25. assertFalse(
  26. "The status of the select-all checkbox is expected to be False.",
  27. Boolean.parseBoolean(selectAllStatusLabel.getText()));
  28. }
  29. }