From c5cdca0c6290b96cf9499d29b4b5380466b33082 Mon Sep 17 00:00:00 2001 From: Teemu Suo-Anttila Date: Mon, 12 Jun 2017 16:29:49 +0300 Subject: Add handler for row height changing in Grid Fixes #9488 --- .../tests/components/grid/GridRowHeightChange.java | 2 ++ .../components/grid/GridRowHeightChangeTest.java | 22 ++++++++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) (limited to 'uitest') diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridRowHeightChange.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridRowHeightChange.java index 34fc2048be..1b3a7a0ab2 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridRowHeightChange.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridRowHeightChange.java @@ -4,6 +4,7 @@ import java.util.Arrays; import java.util.List; import java.util.stream.IntStream; +import com.vaadin.annotations.Widgetset; import com.vaadin.server.VaadinRequest; import com.vaadin.shared.ui.grid.HeightMode; import com.vaadin.tests.components.AbstractReindeerTestUI; @@ -12,6 +13,7 @@ import com.vaadin.ui.NativeSelect; import com.vaadin.ui.TabSheet; import com.vaadin.ui.VerticalLayout; +@Widgetset("com.vaadin.DefaultWidgetSet") public class GridRowHeightChange extends AbstractReindeerTestUI { private final List themes = Arrays.asList("valo", "reindeer", diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridRowHeightChangeTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridRowHeightChangeTest.java index 18ecba5696..dbc9278229 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridRowHeightChangeTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridRowHeightChangeTest.java @@ -25,19 +25,25 @@ public class GridRowHeightChangeTest extends MultiBrowserTest { @Test public void changeThemeAndMeasureGridHeight() { + // Initial check + verifyGridSize(); + for (String theme : themes) { // select theme $(NativeSelectElement.class).first().selectByText(theme); - GridElement grid = $(GridElement.class).first(); + verifyGridSize(); + } + } - int gridHeight = grid.getSize().getHeight(); - int tabsheetHeight = findElements( - By.className("v-tabsheet-content")).get(0).getSize() - .getHeight(); + private void verifyGridSize() { + GridElement grid = $(GridElement.class).first(); - assertEquals("Grid's visible height should be equal to Grid height", - gridHeight, tabsheetHeight, 1); - } + 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); } } -- cgit v1.2.3