aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/test/java/com/vaadin/tests/components/customlayout/CustomLayoutUpdateCaptionTest.java
blob: 272355557a3aa56951e3ebe76a3027860f28b6e0 (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
package com.vaadin.tests.components.customlayout;

import static org.junit.Assert.assertEquals;

import java.util.List;

import org.junit.Test;

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

public class CustomLayoutUpdateCaptionTest extends SingleBrowserTest {

    @Test
    public void captionUpdated() {
        openTestURL();
        List<TextFieldElement> tfs = $(TextFieldElement.class).all();
        TextFieldElement tf1 = tfs.get(0);
        TextFieldElement tf2 = tfs.get(1);

        assertEquals("initial", tf1.getCaption());
        assertEquals("initial", tf2.getCaption());

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

        assertEquals("updated", tf1.getCaption());
        assertEquals("updated", tf2.getCaption());

    }
}