diff options
author | Teemu Suo-Anttila <teemusa@vaadin.com> | 2015-01-21 11:33:53 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2015-01-26 15:53:36 +0000 |
commit | a6a3060fb21441cf9925f70c5ff4fed327b47ca6 (patch) | |
tree | 9a1d3b2a5cced73bdb81ec40978c476da1629a29 /uitest | |
parent | 425e91b77da4b7078a9ab1a4df141c3de71de355 (diff) | |
download | vaadin-framework-a6a3060fb21441cf9925f70c5ff4fed327b47ca6.tar.gz vaadin-framework-a6a3060fb21441cf9925f70c5ff4fed327b47ca6.zip |
Fix Grid not always showing select all checkbox (#16397)
Change-Id: I35f0e9fa615ab23153b638b80f12cd539bd2c52e
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/src/com/vaadin/tests/components/grid/GridMultiSelectionOnInit.java | 34 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/components/grid/GridMultiSelectionOnInitTest.java | 35 |
2 files changed, 69 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/grid/GridMultiSelectionOnInit.java b/uitest/src/com/vaadin/tests/components/grid/GridMultiSelectionOnInit.java new file mode 100644 index 0000000000..10d4977623 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/grid/GridMultiSelectionOnInit.java @@ -0,0 +1,34 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.grid; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Grid; +import com.vaadin.ui.Grid.SelectionMode; + +public class GridMultiSelectionOnInit extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + Grid grid = new Grid(); + grid.addColumn("foo", String.class); + grid.addRow("Foo 1"); + grid.addRow("Foo 2"); + grid.setSelectionMode(SelectionMode.MULTI); + addComponent(grid); + } +} diff --git a/uitest/src/com/vaadin/tests/components/grid/GridMultiSelectionOnInitTest.java b/uitest/src/com/vaadin/tests/components/grid/GridMultiSelectionOnInitTest.java new file mode 100644 index 0000000000..5f5b4df8de --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/grid/GridMultiSelectionOnInitTest.java @@ -0,0 +1,35 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.grid; + +import static org.junit.Assert.assertTrue; + +import org.junit.Test; +import org.openqa.selenium.By; + +import com.vaadin.testbench.elements.GridElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class GridMultiSelectionOnInitTest extends MultiBrowserTest { + + @Test + public void testSelectAllCheckBoxExists() { + openTestURL(); + assertTrue("The select all checkbox was missing.", + $(GridElement.class).first().getHeaderCell(0, 0) + .isElementPresent(By.tagName("input"))); + } +} |