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.

OnlyCollapsibleInMenu.java 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package com.vaadin.tests.components.table;
  2. import static org.junit.Assert.assertEquals;
  3. import org.junit.Test;
  4. import com.vaadin.testbench.elements.TableElement;
  5. import com.vaadin.tests.tb3.SingleBrowserTest;
  6. import com.vaadin.v7.shared.ui.table.CollapseMenuContent;
  7. public class OnlyCollapsibleInMenu extends SingleBrowserTest {
  8. @Override
  9. protected Class<?> getUIClass() {
  10. return Tables.class;
  11. }
  12. @Test
  13. public void testOnlyCollapsibleInMenu() {
  14. openTestURL();
  15. TableElement table = $(TableElement.class).first();
  16. selectMenuPath("Component", "Columns", "Property 3", "Collapsible");
  17. table.getCollapseMenuToggle().click();
  18. assertEquals("Property 3 should still be in the context menu",
  19. "Property 3", table.getContextMenu().getItem(2).getText());
  20. selectMenuPath("Component", "Features", "Collapsible menu content",
  21. CollapseMenuContent.COLLAPSIBLE_COLUMNS.toString());
  22. table.getCollapseMenuToggle().click();
  23. assertEquals("Property 3 should not be in the context menu",
  24. "Property 4", table.getContextMenu().getItem(2).getText());
  25. selectMenuPath("Component", "Features", "Collapsible menu content",
  26. CollapseMenuContent.ALL_COLUMNS.toString());
  27. table.getCollapseMenuToggle().click();
  28. assertEquals("Property 3 should again be in the context menu",
  29. "Property 3", table.getContextMenu().getItem(2).getText());
  30. }
  31. }