blob: dbc9278229fa3c0b7d1230b4daae7ae23c11fcdb (
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
38
39
40
41
42
43
44
45
46
47
48
49
|
package com.vaadin.tests.components.grid;
import static org.junit.Assert.assertEquals;
import java.util.Arrays;
import java.util.List;
import org.junit.Test;
import com.vaadin.testbench.By;
import com.vaadin.testbench.elements.GridElement;
import com.vaadin.testbench.elements.NativeSelectElement;
import com.vaadin.tests.tb3.MultiBrowserTest;
public class GridRowHeightChangeTest extends MultiBrowserTest {
private final List<String> themes = Arrays.asList("valo", "reindeer",
"runo", "chameleon", "base");
@Override
public void setup() throws Exception {
super.setup();
openTestURL();
}
@Test
public void changeThemeAndMeasureGridHeight() {
// Initial check
verifyGridSize();
for (String theme : themes) {
// select theme
$(NativeSelectElement.class).first().selectByText(theme);
verifyGridSize();
}
}
private void verifyGridSize() {
GridElement grid = $(GridElement.class).first();
int gridHeight = grid.getSize().getHeight();
int tabsheetHeight = findElements(By.className("v-tabsheet-content"))
.get(0).getSize().getHeight();
assertEquals("Grid's visible height should be equal to Grid height",
gridHeight, tabsheetHeight, 1);
}
}
|