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.

NullRenderersTest.java 2.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * Copyright 2000-2016 Vaadin Ltd.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy of
  6. * the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. * License for the specific language governing permissions and limitations under
  14. * the License.
  15. */
  16. package com.vaadin.tests.components.grid;
  17. import com.vaadin.testbench.elements.GridElement;
  18. import com.vaadin.testbench.elements.LabelElement;
  19. import com.vaadin.testbench.parallel.TestCategory;
  20. import com.vaadin.tests.tb3.MultiBrowserTest;
  21. import org.junit.Test;
  22. import java.util.List;
  23. import static org.junit.Assert.assertEquals;
  24. @TestCategory("grid")
  25. public class NullRenderersTest extends MultiBrowserTest {
  26. @Test
  27. public void testDefaults() throws Exception {
  28. openTestURL();
  29. GridElement grid = findGridWithDefaults();
  30. assertEquals("-- No Text --", grid.getCell(0, 0).getText());
  31. assertEquals("-- No Jokes --", grid.getCell(0, 1).getText());
  32. assertEquals("-- Never --", grid.getCell(0, 2).getText());
  33. assertEquals("-- Nothing --", grid.getCell(0, 3).getText());
  34. assertEquals("-- No Control --", grid.getCell(0, 5).getText());
  35. }
  36. @Test
  37. public void testNoDefaults() throws Exception {
  38. openTestURL();
  39. GridElement grid = findGridNoDefaults();
  40. assertEquals("", grid.getCell(0, 0).getText());
  41. assertEquals("", grid.getCell(0, 1).getText());
  42. assertEquals("", grid.getCell(0, 2).getText());
  43. assertEquals("", grid.getCell(0, 3).getText());
  44. assertEquals("", grid.getCell(0, 5).getText());
  45. }
  46. private GridElement findGridWithDefaults() {
  47. return $(LegacyGridElement.class).id("test-grid-defaults");
  48. }
  49. private GridElement findGridNoDefaults() {
  50. return $(LegacyGridElement.class).id("test-grid");
  51. }
  52. private LabelElement findDebugLabel() {
  53. return $(LabelElement.class).id(CustomRenderer.DEBUG_LABEL_ID);
  54. }
  55. }