aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/com
diff options
context:
space:
mode:
authorJohn Ahlroos <john@vaadin.com>2014-04-29 11:33:17 +0300
committerJohn Ahlroos <john@vaadin.com>2014-04-29 11:33:17 +0300
commit55ab9980811c52735a0ee1943907327f5ca0fcd8 (patch)
tree2d0a0157b74d66e4076e8f1435345277083b554c /uitest/src/com
parent3cba005cdbd00b47618fce6b5aa08c19622f400e (diff)
downloadvaadin-framework-55ab9980811c52735a0ee1943907327f5ca0fcd8.tar.gz
vaadin-framework-55ab9980811c52735a0ee1943907327f5ca0fcd8.zip
Added test for previously fixed state ordering issue #13334
Test for fix submitted in 3cba005. Change-Id: I92ee775403cbfb315499f2bcab90c895bf734832
Diffstat (limited to 'uitest/src/com')
-rw-r--r--uitest/src/com/vaadin/tests/components/grid/GridSingleColumn.java57
-rw-r--r--uitest/src/com/vaadin/tests/components/grid/GridSingleColumnTest.java38
2 files changed, 95 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/grid/GridSingleColumn.java b/uitest/src/com/vaadin/tests/components/grid/GridSingleColumn.java
new file mode 100644
index 0000000000..08b4f0c0d7
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/grid/GridSingleColumn.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2000-2013 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.data.Item;
+import com.vaadin.data.util.IndexedContainer;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.components.grid.Grid;
+import com.vaadin.ui.components.grid.GridColumn;
+
+public class GridSingleColumn extends AbstractTestUI {
+
+ @Override
+ protected void setup(VaadinRequest request) {
+
+ IndexedContainer indexedContainer = new IndexedContainer();
+ indexedContainer.addContainerProperty("column1", String.class, "");
+
+ for (int i = 0; i < 100; i++) {
+ Item addItem = indexedContainer.addItem(i);
+ addItem.getItemProperty("column1").setValue("cell");
+ }
+
+ Grid grid = new Grid(indexedContainer);
+
+ GridColumn column = grid.getColumn("column1");
+
+ column.setHeaderCaption("Header");
+
+ addComponent(grid);
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Tests a single column grid";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return null;
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/components/grid/GridSingleColumnTest.java b/uitest/src/com/vaadin/tests/components/grid/GridSingleColumnTest.java
new file mode 100644
index 0000000000..9c1ec88df7
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/grid/GridSingleColumnTest.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2000-2013 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.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+
+import org.junit.Test;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebElement;
+
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+public class GridSingleColumnTest extends MultiBrowserTest {
+
+ @Test
+ public void headerIsVisible() {
+ openTestURL();
+
+ WebElement header = getDriver().findElement(
+ By.className("v-grid-header"));
+ WebElement cell = header.findElement(By.className("v-grid-cell"));
+ assertThat(cell.getText(), is("Header"));
+ }
+}