2 * Copyright 2000-2016 Vaadin Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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
16 package com.vaadin.tests.components.grid.basicfeatures;
18 import static org.junit.Assert.assertEquals;
19 import static org.junit.Assert.assertFalse;
20 import static org.junit.Assert.assertTrue;
22 import org.junit.Before;
23 import org.junit.Test;
25 import com.vaadin.testbench.By;
26 import com.vaadin.testbench.elements.NotificationElement;
27 import com.vaadin.testbench.parallel.TestCategory;
28 import com.vaadin.tests.components.grid.GridCellFocusOnResetSizeTest.MyGridElement;
29 import com.vaadin.tests.tb3.MultiBrowserTest;
30 import com.vaadin.v7.testbench.customelements.GridElement;
33 public class GridDefaultTextRendererTest extends MultiBrowserTest {
35 private GridElement grid;
41 grid = $(MyGridElement.class).first();
42 assertFalse("There was an unexpected notification during init",
43 $(NotificationElement.class).exists());
47 public void testNullIsRenderedAsEmptyStringByDefaultTextRenderer() {
48 assertTrue("First cell should've been empty",
49 grid.getCell(0, 0).getText().isEmpty());
53 public void testStringIsRenderedAsStringByDefaultTextRenderer() {
54 assertEquals("Second cell should've been populated ", "string",
55 grid.getCell(1, 0).getText());
59 public void testWarningShouldNotBeInDebugLog() {
60 assertFalse("Warning visible with string content.", isElementPresent(
61 By.xpath("//span[contains(.,'attached:#1')]")));