aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/test/java/com/vaadin/tests/components/ui/UIsInMultipleTabsTest.java
blob: b053ef388007f14559a7d6f9417523b382306839 (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
package com.vaadin.tests.components.ui;

import static org.junit.Assert.assertEquals;

import org.junit.Test;

import com.vaadin.testbench.elements.LabelElement;
import com.vaadin.tests.tb3.MultiBrowserTest;

public class UIsInMultipleTabsTest extends MultiBrowserTest {

    @Test
    public void testPageReloadChangesUI() throws Exception {
        openTestURL();
        assertUI(1);
        openTestURL();
        assertUI(2);
        openTestURL("restartApplication");
        assertUI(1);
    }

    private void assertUI(int i) {
        assertEquals("Unexpected UI found,", "This is UI number " + i,
                $(LabelElement.class).first().getText());
    }
}