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.

GridFrozenColumnReplaceTest.java 1.1KB

12345678910111213141516171819202122232425262728293031323334
  1. package com.vaadin.tests.components.grid;
  2. import static org.junit.Assert.assertEquals;
  3. import static org.junit.Assert.assertFalse;
  4. import static org.junit.Assert.assertTrue;
  5. import org.junit.Test;
  6. import com.vaadin.testbench.By;
  7. import com.vaadin.testbench.elements.ButtonElement;
  8. import com.vaadin.testbench.elements.GridElement;
  9. import com.vaadin.tests.tb3.SingleBrowserTest;
  10. public class GridFrozenColumnReplaceTest extends SingleBrowserTest {
  11. @Test
  12. public void testChangingColumns() {
  13. openTestURL("debug");
  14. GridElement grid = $(GridElement.class).first();
  15. String caption = grid.getHeaderCell(0, 1).getText();
  16. assertFalse("Unexpected column caption: " + caption,
  17. caption != null && caption.startsWith("New "));
  18. $(ButtonElement.class).first().click();
  19. assertEquals("Unexpected error notifications,", 0,
  20. findElements(By.className("v-Notification-error")).size());
  21. caption = grid.getHeaderCell(0, 1).getText();
  22. assertTrue("Unexpected column caption: " + caption,
  23. caption != null && caption.startsWith("New "));
  24. }
  25. }