aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/test/java/com/vaadin/tests/components/grid/GridMultiSelectEmptyTest.java
blob: 1d93a8b509d0f4c84d9dc7cd70d269995b192da5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package com.vaadin.tests.components.grid;

import static org.junit.Assert.assertEquals;

import org.junit.Test;

import com.vaadin.testbench.elements.ButtonElement;
import com.vaadin.testbench.elements.GridElement;
import com.vaadin.tests.tb3.MultiBrowserTest;

public class GridMultiSelectEmptyTest extends MultiBrowserTest {

    @Test
    public void testCheckBoxColumnCorrectSize() {
        openTestURL();

        GridElement grid = $(GridElement.class).first();
        int startingWidth = grid.getHeaderCell(0, 0).getSize().getWidth();
        $(ButtonElement.class).caption("Add Row").first().click();
        int currentWidth = grid.getHeaderCell(0, 0).getSize().getWidth();

        assertEquals(
                "Checkbox column size should not change when data is added",
                startingWidth, currentWidth);

        $(ButtonElement.class).caption("Recalculate").first().click();
        currentWidth = grid.getHeaderCell(0, 0).getSize().getWidth();
        assertEquals(
                "Checkbox column size should not change when columns are recalculated",
                startingWidth, currentWidth);
    }

}