aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/test/java/com/vaadin/tests/components/grid/GridFrozenColumnReplaceTest.java
blob: 4ad8a48fa27c856b2cea86b59bd730bbd341c36e (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
package com.vaadin.tests.components.grid;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import org.junit.Test;

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

public class GridFrozenColumnReplaceTest extends SingleBrowserTest {

    @Test
    public void testChangingColumns() {
        openTestURL("debug");

        GridElement grid = $(GridElement.class).first();
        String caption = grid.getHeaderCell(0, 1).getText();
        assertFalse("Unexpected column caption: " + caption,
                caption != null && caption.startsWith("New "));

        $(ButtonElement.class).first().click();

        assertEquals("Unexpected error notifications,", 0,
                findElements(By.className("v-Notification-error")).size());

        caption = grid.getHeaderCell(0, 1).getText();
        assertTrue("Unexpected column caption: " + caption,
                caption != null && caption.startsWith("New "));
    }
}