diff options
author | John Ahlroos <john@vaadin.com> | 2014-08-05 13:58:00 +0300 |
---|---|---|
committer | Teemu Suo-Anttila <teemusa@vaadin.com> | 2014-08-06 09:32:51 +0000 |
commit | 9d051687d1f39690c356aa3f916c0dc900cb9af0 (patch) | |
tree | 7c65d264efbc25d36e869cb83f4b9741b4b75f38 /uitest/src | |
parent | 6aa1aab8a77b5aece4eb34fcf447baa129380de0 (diff) | |
download | vaadin-framework-9d051687d1f39690c356aa3f916c0dc900cb9af0.tar.gz vaadin-framework-9d051687d1f39690c356aa3f916c0dc900cb9af0.zip |
Trigger ComplexRenderer.setContentVisible(false) initially #13334
Change-Id: Id2ebb2f7f6c0480ab6353df0ae87fea3b1153ea0
Diffstat (limited to 'uitest/src')
-rw-r--r-- | uitest/src/com/vaadin/tests/components/grid/GridClientRenderers.java | 24 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/widgetset/client/grid/GridClientColumnRendererConnector.java | 7 |
2 files changed, 24 insertions, 7 deletions
diff --git a/uitest/src/com/vaadin/tests/components/grid/GridClientRenderers.java b/uitest/src/com/vaadin/tests/components/grid/GridClientRenderers.java index d1aec66dbd..fd3c8d5b2f 100644 --- a/uitest/src/com/vaadin/tests/components/grid/GridClientRenderers.java +++ b/uitest/src/com/vaadin/tests/components/grid/GridClientRenderers.java @@ -17,6 +17,7 @@ package com.vaadin.tests.components.grid; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertTrue; import org.junit.Test; @@ -80,7 +81,7 @@ public class GridClientRenderers extends MultiBrowserTest { $(NativeButtonElement.class).caption("Add").first().click(); // Click the button in cell 1,1 - TestBenchElement cell = getGrid().getCell(1, 1); + TestBenchElement cell = getGrid().getCell(1, 2); WebElement gwtButton = cell.findElement(By.tagName("button")); gwtButton.click(); @@ -102,7 +103,7 @@ public class GridClientRenderers extends MultiBrowserTest { $(NativeButtonElement.class).caption("DetachAttach").first().click(); // Click the button in cell 1,1 - TestBenchElement cell = getGrid().getCell(1, 1); + TestBenchElement cell = getGrid().getCell(1, 2); WebElement gwtButton = cell.findElement(By.tagName("button")); gwtButton.click(); @@ -159,17 +160,28 @@ public class GridClientRenderers extends MultiBrowserTest { openTestURL(); - addColumn(Renderers.CPLX_RENDERER); + // Test initial renderering with contentVisible = False + TestBenchElement cell = getGrid().getCell(51, 1); + String backgroundColor = cell.getCssValue("backgroundColor"); + assertEquals("Background color was not red.", colorRed, backgroundColor); + // data arrives... sleep((int) (latency * SLEEP_MULTIPLIER)); + // Content becomes visible + cell = getGrid().getCell(51, 1); + backgroundColor = cell.getCssValue("backgroundColor"); + assertNotEquals("Background color was red.", colorRed, backgroundColor); + + // scroll down, new cells becomes contentVisible = False getGrid().scrollToRow(60); + // Cell should be red (setContentVisible set cell red) - TestBenchElement cell = getGrid().getCell(51, 1); - String backgroundColor = cell.getCssValue("backgroundColor"); + cell = getGrid().getCell(55, 1); + backgroundColor = cell.getCssValue("backgroundColor"); assertEquals("Background color was not red.", colorRed, backgroundColor); - // Wait for data to arrive + // data arrives... sleep((int) (latency * SLEEP_MULTIPLIER)); // Cell should no longer be red diff --git a/uitest/src/com/vaadin/tests/widgetset/client/grid/GridClientColumnRendererConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/grid/GridClientColumnRendererConnector.java index e685034c7b..c0e57e97aa 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/grid/GridClientColumnRendererConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/grid/GridClientColumnRendererConnector.java @@ -64,7 +64,7 @@ public class GridClientColumnRendererConnector extends private class DelayedDataSource implements DataSource<String> { private DataSource<String> ds; - private int firstRowIndex; + private int firstRowIndex = -1; private int numberOfRows; private DataChangeHandler dataChangeHandler; private int latency; @@ -139,6 +139,11 @@ public class GridClientColumnRendererConnector extends grid.addColumn(c); grid.getHeader().getDefaultRow().getCell(0).setText("Column 1"); + // Add another column with a custom complex renderer + c = createColumnWithRenderer(Renderers.CPLX_RENDERER); + grid.addColumn(c); + grid.getHeader().getDefaultRow().getCell(1).setText("Column 2"); + // Add method for testing sort event firing grid.addSortHandler(new SortEventHandler<String>() { @Override |