aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/test/java/com/vaadin/tests/application/RefreshFragmentChangeTest.java
blob: ea415bcaae7d679580547e6351155d726ad6b39c (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
package com.vaadin.tests.application;

import org.junit.Assert;
import org.junit.Test;

import com.vaadin.testbench.By;
import com.vaadin.tests.tb3.MultiBrowserTest;

public class RefreshFragmentChangeTest extends MultiBrowserTest {
    @Override
    protected Class<?> getUIClass() {
        return com.vaadin.tests.application.RefreshStatePreserve.class;
    }

    @Test
    public void testFragmentChange() throws Exception {
        openTestURL();
        assertLogText("1. Initial fragment: null");
        getDriver().get(getTestUrl() + "#asdf");
        assertLogText("2. Fragment changed to asdf");
        openTestURL();
        assertLogText("3. Fragment changed to null");
    }

    private void assertLogText(String expected) {
        waitForElementPresent(By.className("v-label"));
        Assert.assertEquals("Incorrect log text,", expected, getLogRow(0));
    }
}