blob: 2fa30b36f2fe32dbb16d97a8c7c67cac4de6d095 (
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
|
package com.vaadin.tests.components.window;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import com.vaadin.testbench.elements.ButtonElement;
import com.vaadin.testbench.elements.WindowElement;
import com.vaadin.tests.tb3.MultiBrowserTest;
public class RepaintWindowContentsTest extends MultiBrowserTest {
@Test
public void testRepaintWindowContents() throws Exception {
openTestURL();
assertWindowContents("Button 1");
toggleWindowContents();
assertWindowContents("Button 2");
toggleWindowContents();
assertWindowContents("Button 1");
toggleWindowContents();
assertWindowContents("Button 2");
}
private void toggleWindowContents() {
getWindowButton().click();
}
private void assertWindowContents(String expected) {
assertEquals("Unexpected window contents,", expected,
getWindowButton().getText());
}
private ButtonElement getWindowButton() {
return $(WindowElement.class).$(ButtonElement.class).first();
}
}
|