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.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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.v7.tests.components.grid;
  17. import static org.junit.Assert.assertEquals;
  18. import org.junit.Test;
  19. import com.vaadin.testbench.customelements.GridElement;
  20. import com.vaadin.testbench.parallel.TestCategory;
  21. import com.vaadin.tests.tb3.MultiBrowserTest;
  22. @TestCategory("grid")
  23. public class NullRenderersTest extends MultiBrowserTest {
  24. @Test
  25. public void testDefaults() throws Exception {
  26. openTestURL();
  27. GridElement grid = findGridWithDefaults();
  28. assertEquals("-- No Text --", grid.getCell(0, 0).getText());
  29. assertEquals("-- No Jokes --", grid.getCell(0, 1).getText());
  30. assertEquals("-- Never --", grid.getCell(0, 2).getText());
  31. assertEquals("-- Nothing --", grid.getCell(0, 3).getText());
  32. assertEquals("-- No Control --", grid.getCell(0, 5).getText());
  33. }
  34. @Test
  35. public void testNoDefaults() throws Exception {
  36. openTestURL();
  37. GridElement grid = findGridNoDefaults();
  38. assertEquals("", grid.getCell(0, 0).getText());
  39. assertEquals("", grid.getCell(0, 1).getText());
  40. assertEquals("", grid.getCell(0, 2).getText());
  41. assertEquals("", grid.getCell(0, 3).getText());
  42. assertEquals("", grid.getCell(0, 5).getText());
  43. }
  44. private GridElement findGridWithDefaults() {
  45. return $(GridElement.class).id("test-grid-defaults");
  46. }
  47. private GridElement findGridNoDefaults() {
  48. return $(GridElement.class).id("test-grid");
  49. }
  50. }