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.treetable;
18 import static org.junit.Assert.assertEquals;
20 import org.junit.Test;
21 import org.openqa.selenium.By;
22 import org.openqa.selenium.WebElement;
24 import com.vaadin.testbench.TestBenchElement;
25 import com.vaadin.tests.tb3.MultiBrowserTest;
26 import com.vaadin.v7.testbench.customelements.TreeTableElement;
29 * Tests that TreeTable with ContainerHierarchicalWrapper is updated correctly
30 * when the setParent() is called for the item just added
34 public class TreeTableContainerHierarchicalWrapperTest
35 extends MultiBrowserTest {
38 public void testStructure() throws InterruptedException {
41 TreeTableElement treeTable = $(TreeTableElement.class).first();
42 WebElement findElement = treeTable.getCell(0, 0)
43 .findElement(By.className("v-treetable-treespacer"));
46 TestBenchElement cell = treeTable.getCell(5, 0);
47 WebElement findElement2 = cell
48 .findElement(By.className("v-treetable-treespacer"));
49 assertEquals("Item 0-5", cell.getText());
52 TestBenchElement cell2 = treeTable.getCell(10, 0);
53 assertEquals("Item 0-5-5", cell2.getText());