aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/test/java/com/vaadin/v7/tests/components/grid/RemoveHiddenColumnTest.java
blob: 730dc1665047f64038cfb72500016ae981030ffe (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
34
35
36
37
38
39
40
41
42
43
44
45
package com.vaadin.v7.tests.components.grid;

import static org.junit.Assert.assertEquals;

import org.junit.Test;

import com.vaadin.testbench.elements.ButtonElement;
import com.vaadin.tests.tb3.SingleBrowserTest;

public class RemoveHiddenColumnTest extends SingleBrowserTest {

    @Test
    public void removeHiddenColumnInEmptyGrid() {
        openTestURL("debug");
        removeColumns();
    }

    @Test
    public void removeHiddenColumnInPopulatedGrid() {
        openTestURL("debug");
        ButtonElement add = $(ButtonElement.class).id("add");
        add.click();
        removeColumns();

    }

    private void removeColumns() {
        ButtonElement remove = $(ButtonElement.class).id("remove");
        remove.click();
        assertEquals("1. Removed column 'First Name' (hidden)", getLogRow(0));
        assertNoErrorNotifications();

        remove.click();
        assertEquals("2. Removed column 'Last Name'", getLogRow(0));
        assertNoErrorNotifications();
        remove.click();
        assertEquals("3. Removed column 'Email' (hidden)", getLogRow(0));
        assertNoErrorNotifications();
        remove.click();
        assertEquals("4. Removed column 'Age'", getLogRow(0));
        assertNoErrorNotifications();

    }

}