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.server;
18 import org.junit.Assert;
19 import org.junit.Test;
21 import com.vaadin.testbench.elements.ButtonElement;
22 import com.vaadin.testbench.parallel.TestCategory;
23 import com.vaadin.tests.tb3.MultiBrowserTest;
24 import com.vaadin.v7.testbench.customelements.GridElement;
27 * Tests that removing and adding rows doesn't cause an infinite loop in the
33 public class GridClearContainerTest extends MultiBrowserTest {
35 private final String ERRORNOTE = "Unexpected cell contents.";
38 public void clearAndReadd() {
40 ButtonElement button = $(ButtonElement.class)
41 .caption("Clear and re-add").first();
42 GridElement grid = $(GridElement.class).first();
43 Assert.assertEquals(ERRORNOTE, "default", grid.getCell(0, 0).getText());
44 Assert.assertEquals(ERRORNOTE, "default", grid.getCell(1, 0).getText());
46 Assert.assertEquals(ERRORNOTE, "Updated value 1",
47 grid.getCell(0, 0).getText());
48 Assert.assertEquals(ERRORNOTE, "Updated value 2",
49 grid.getCell(1, 0).getText());