summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <teemusa@vaadin.com>2017-03-02 15:16:54 +0200
committerHenri Sara <henri.sara@gmail.com>2017-03-07 12:36:54 +0200
commit6f8518579fd3301031800dffe046f8719f4cafd8 (patch)
tree4d7a54839a0c0db9ac74fee5d98defa9fdcdc452 /uitest
parentf5c15b9b2bcc4eeef210a5977449c76f3b952209 (diff)
downloadvaadin-framework-6f8518579fd3301031800dffe046f8719f4cafd8.tar.gz
vaadin-framework-6f8518579fd3301031800dffe046f8719f4cafd8.zip
Picked all changes from 7.7
Synchronises parts of compatibility package code to match 7.7 Picks suitable patches for 8 code as well
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/customlayout/CustomLayoutUpdateCaption.java42
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/draganddropwrapper/Html5DropDenied.java80
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/grid/JavaScriptRenderers.java25
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/grid/JavaScriptStringRendererWithDestoryMethod.java15
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/table/TableRemovedQuicklySendsInvalidRpcCalls.java4
-rw-r--r--uitest/src/main/resources/com/vaadin/tests/components/grid/JavaScriptStringRenderer.js7
-rw-r--r--uitest/src/main/resources/com/vaadin/tests/components/grid/JavaScriptStringRendererWithDestoryMethod.js13
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxItemIconTest.java40
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/customlayout/CustomLayoutUpdateCaptionTest.java30
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/grid/GridSelectionTest.java10
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/grid/JavaScriptRenderersTest.java19
-rw-r--r--uitest/src/test/java/com/vaadin/tests/themes/valo/ModalWindowTest.java41
-rw-r--r--uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/GridBasicFeaturesTest.java4
-rw-r--r--uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/server/GridColumnReorderTest.java23
-rw-r--r--uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/server/GridColumnResizeTest.java8
-rw-r--r--uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/server/GridKeyboardNavigationTest.java13
16 files changed, 363 insertions, 11 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/customlayout/CustomLayoutUpdateCaption.java b/uitest/src/main/java/com/vaadin/tests/components/customlayout/CustomLayoutUpdateCaption.java
new file mode 100644
index 0000000000..6908ba1582
--- /dev/null
+++ b/uitest/src/main/java/com/vaadin/tests/components/customlayout/CustomLayoutUpdateCaption.java
@@ -0,0 +1,42 @@
+package com.vaadin.tests.components.customlayout;
+
+import com.vaadin.annotations.Widgetset;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.CustomLayout;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.UI;
+import com.vaadin.ui.VerticalLayout;
+
+@Widgetset("com.vaadin.DefaultWidgetSet")
+public class CustomLayoutUpdateCaption extends UI {
+ @Override
+ protected void init(VaadinRequest vaadinRequest) {
+ CustomLayout content = new CustomLayout();
+ content.setTemplateContents("<div>\n"
+ + " <div location=\"test1\"></div>\n"
+ + " <div location=\"test2\"></div>\n"
+ + " <div location=\"okbutton\"></div>\n" + "</div>");
+ content.setSizeUndefined();
+ setContent(content);
+
+ Button loginButton = new Button("Test");
+ final TextField username1 = new TextField();
+ final TextField username2 = new TextField();
+ username1.setCaption("initial");
+ username2.setCaption("initial");
+ content.addComponent(username1, "test1");
+ content.addComponent(new VerticalLayout(username2), "test2");
+ content.addComponent(loginButton, "okbutton");
+
+ loginButton.addClickListener(new ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent e) {
+ username1.setCaption("updated");
+ username2.setCaption("updated");
+ }
+ });
+ }
+} \ No newline at end of file
diff --git a/uitest/src/main/java/com/vaadin/tests/components/draganddropwrapper/Html5DropDenied.java b/uitest/src/main/java/com/vaadin/tests/components/draganddropwrapper/Html5DropDenied.java
new file mode 100644
index 0000000000..2f66033eed
--- /dev/null
+++ b/uitest/src/main/java/com/vaadin/tests/components/draganddropwrapper/Html5DropDenied.java
@@ -0,0 +1,80 @@
+package com.vaadin.tests.components.draganddropwrapper;
+
+import com.vaadin.event.dd.DragAndDropEvent;
+import com.vaadin.event.dd.DropHandler;
+import com.vaadin.event.dd.acceptcriteria.AcceptAll;
+import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
+import com.vaadin.event.dd.acceptcriteria.ClientSideCriterion;
+import com.vaadin.event.dd.acceptcriteria.Not;
+import com.vaadin.server.ThemeResource;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUIWithLog;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.DragAndDropWrapper;
+import com.vaadin.ui.DragAndDropWrapper.DragStartMode;
+import com.vaadin.ui.Image;
+
+public class Html5DropDenied extends AbstractTestUIWithLog {
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ Image sample = new Image();
+ sample.setSource(new ThemeResource("../runo/icons/64/document.png"));
+
+ Button neverButton = new Button("Never accepts drop");
+ neverButton.setId("never");
+ neverButton.addClickListener(new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ log("click on " + event.getButton().getCaption());
+ }
+ });
+
+ DragAndDropWrapper neverAccept = new DragAndDropWrapper(neverButton);
+ neverAccept.setSizeFull();
+ neverAccept.setDragStartMode(DragStartMode.NONE);
+ neverAccept.setDropHandler(new DropHandler() {
+
+ @Override
+ public AcceptCriterion getAcceptCriterion() {
+ return new Not((ClientSideCriterion) AcceptAll.get());
+ }
+
+ @Override
+ public void drop(DragAndDropEvent event) {
+ log("This should never happen");
+ }
+ });
+ Button alwaysButton = new Button("always accepts drop");
+ alwaysButton.setId("always");
+ alwaysButton.addClickListener(new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ log("click on " + event.getButton().getCaption());
+ }
+ });
+
+ DragAndDropWrapper alwaysAccept = new DragAndDropWrapper(alwaysButton);
+ alwaysAccept.setSizeFull();
+ alwaysAccept.setDragStartMode(DragStartMode.NONE);
+ alwaysAccept.setDropHandler(new DropHandler() {
+
+ @Override
+ public AcceptCriterion getAcceptCriterion() {
+ return AcceptAll.get();
+ }
+
+ @Override
+ public void drop(DragAndDropEvent event) {
+ log("Drop on always accept");
+ }
+ });
+
+ addComponent(sample);
+ addComponent(neverAccept);
+ addComponent(alwaysAccept);
+
+ }
+
+} \ No newline at end of file
diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/JavaScriptRenderers.java b/uitest/src/main/java/com/vaadin/tests/components/grid/JavaScriptRenderers.java
index acf58c2217..16702dd831 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/grid/JavaScriptRenderers.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/grid/JavaScriptRenderers.java
@@ -18,10 +18,14 @@ package com.vaadin.tests.components.grid;
import java.util.ArrayList;
import java.util.List;
+import com.vaadin.annotations.Widgetset;
import com.vaadin.server.VaadinRequest;
import com.vaadin.tests.components.AbstractReindeerTestUI;
+import com.vaadin.ui.Button;
import com.vaadin.ui.Grid;
+import com.vaadin.ui.Label;
+@Widgetset("com.vaadin.DefaultWidgetSet")
public class JavaScriptRenderers extends AbstractReindeerTestUI {
public static class ItemBean {
@@ -81,6 +85,8 @@ public class JavaScriptRenderers extends AbstractReindeerTestUI {
}
}
+ private Grid<ItemBean> grid;
+
@Override
protected void setup(VaadinRequest request) {
List<ItemBean> items = new ArrayList<>(1000);
@@ -92,6 +98,20 @@ public class JavaScriptRenderers extends AbstractReindeerTestUI {
items.add(bean);
}
+ Label clientLog = new Label();
+ clientLog.setId("clientLog");
+ addComponent(clientLog);
+ grid = createGrid(items);
+ addComponent(grid);
+
+ addComponent(new Button("Recreate grid", e -> {
+ Grid<ItemBean> newGrid = createGrid(items);
+ replaceComponent(grid, newGrid);
+ grid = newGrid;
+ }));
+ }
+
+ private Grid<ItemBean> createGrid(List<ItemBean> items) {
Grid<ItemBean> grid = new Grid<>();
grid.addColumn(item -> item.getId().toString()).setCaption("Id");
@@ -99,10 +119,13 @@ public class JavaScriptRenderers extends AbstractReindeerTestUI {
.setCaption("Bean");
grid.addColumn(ItemBean::getString, new JavaScriptStringRenderer())
.setCaption("String");
+ grid.addColumn(ItemBean::getString,
+ new JavaScriptStringRendererWithDestoryMethod())
+ .setCaption("String2");
grid.setItems(items);
- addComponent(grid);
+ return grid;
}
}
diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/JavaScriptStringRendererWithDestoryMethod.java b/uitest/src/main/java/com/vaadin/tests/components/grid/JavaScriptStringRendererWithDestoryMethod.java
new file mode 100644
index 0000000000..266ff0736c
--- /dev/null
+++ b/uitest/src/main/java/com/vaadin/tests/components/grid/JavaScriptStringRendererWithDestoryMethod.java
@@ -0,0 +1,15 @@
+package com.vaadin.tests.components.grid;
+
+import com.vaadin.annotations.JavaScript;
+import com.vaadin.tests.components.grid.JavaScriptRenderers.ItemBean;
+import com.vaadin.ui.renderers.AbstractJavaScriptRenderer;
+
+@JavaScript("JavaScriptStringRendererWithDestoryMethod.js")
+public class JavaScriptStringRendererWithDestoryMethod
+ extends AbstractJavaScriptRenderer<ItemBean, String> {
+
+ protected JavaScriptStringRendererWithDestoryMethod() {
+ super(String.class);
+ }
+
+} \ No newline at end of file
diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/TableRemovedQuicklySendsInvalidRpcCalls.java b/uitest/src/main/java/com/vaadin/tests/components/table/TableRemovedQuicklySendsInvalidRpcCalls.java
index 1252e4ce88..ae3667ff29 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/table/TableRemovedQuicklySendsInvalidRpcCalls.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/table/TableRemovedQuicklySendsInvalidRpcCalls.java
@@ -27,11 +27,7 @@ import com.vaadin.tests.components.AbstractReindeerTestUI;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.ConnectorTracker;
-<<<<<<< HEAD
import com.vaadin.v7.ui.Table;
-=======
-import com.vaadin.ui.Table;
->>>>>>> 62c0d73... Remove tracking of unregistered connectors (#8153)
import elemental.json.JsonObject;
diff --git a/uitest/src/main/resources/com/vaadin/tests/components/grid/JavaScriptStringRenderer.js b/uitest/src/main/resources/com/vaadin/tests/components/grid/JavaScriptStringRenderer.js
index 475b453dcc..a309129136 100644
--- a/uitest/src/main/resources/com/vaadin/tests/components/grid/JavaScriptStringRenderer.js
+++ b/uitest/src/main/resources/com/vaadin/tests/components/grid/JavaScriptStringRenderer.js
@@ -2,4 +2,9 @@ com_vaadin_tests_components_grid_JavaScriptStringRenderer = function() {
this.render = function(cell, data) {
cell.element.textContent = data;
}
-} \ No newline at end of file
+
+ this.destroy = function(cell) {
+ document.getElementById("clientLog").innerHTML += "destroy: "
+ + cell.rowIndex + "/" + cell.columnIndex + "<br>";
+ }
+}
diff --git a/uitest/src/main/resources/com/vaadin/tests/components/grid/JavaScriptStringRendererWithDestoryMethod.js b/uitest/src/main/resources/com/vaadin/tests/components/grid/JavaScriptStringRendererWithDestoryMethod.js
new file mode 100644
index 0000000000..a75f2d5a63
--- /dev/null
+++ b/uitest/src/main/resources/com/vaadin/tests/components/grid/JavaScriptStringRendererWithDestoryMethod.js
@@ -0,0 +1,13 @@
+com_vaadin_tests_components_grid_JavaScriptStringRendererWithDestoryMethod = function() {
+ this.render = function(cell, data) {
+ cell.element.textContent = data;
+ // This one is for IE8
+ cell.element.innerText = data;
+ }
+
+ this.destory = function(cell) {
+ document.getElementById("clientLog").innerHTML += "destory: "
+ + cell.rowIndex + "/" + cell.columnIndex + "<br>";
+ }
+
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxItemIconTest.java b/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxItemIconTest.java
index ed6da0317a..7011a58179 100644
--- a/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxItemIconTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxItemIconTest.java
@@ -1,7 +1,10 @@
package com.vaadin.tests.components.combobox;
+import org.junit.Assert;
import org.junit.Test;
+import org.openqa.selenium.Keys;
+import com.vaadin.testbench.By;
import com.vaadin.testbench.elements.ComboBoxElement;
import com.vaadin.tests.tb3.MultiBrowserTest;
@@ -29,4 +32,41 @@ public class ComboBoxItemIconTest extends MultiBrowserTest {
compareScreen("fi-au-selected");
}
+ @Test
+ public void iconResetOnSelectionCancelByEscape() {
+ openTestURL();
+ ComboBoxElement cb = $(ComboBoxElement.class).get(1);
+
+ assertSelection(cb, "hu.gif", "Hungary");
+ cb.openPopup();
+ cb.sendKeys(Keys.UP);
+ assertSelection(cb, "au.gif", "Australia");
+ cb.sendKeys(Keys.ESCAPE);
+ assertSelection(cb, "hu.gif", "Hungary");
+ }
+
+ @Test
+ public void iconResetOnSelectionCancelByClickingOutside() {
+ openTestURL();
+ ComboBoxElement cb = $(ComboBoxElement.class).get(1);
+
+ assertSelection(cb, "hu.gif", "Hungary");
+ cb.openPopup();
+ cb.sendKeys(Keys.UP);
+ assertSelection(cb, "au.gif", "Australia");
+ findElement(By.tagName("body")).click();
+ assertSelection(cb, "hu.gif", "Hungary");
+
+ }
+
+ private void assertSelection(ComboBoxElement cb, String imageSuffix,
+ String caption) {
+ Assert.assertEquals(caption, cb.getValue());
+ String imgSrc = cb.findElement(By.className("v-icon"))
+ .getAttribute("src");
+ imgSrc = imgSrc.substring(imgSrc.lastIndexOf('/') + 1);
+ Assert.assertEquals(imageSuffix, imgSrc);
+
+ }
+
}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/customlayout/CustomLayoutUpdateCaptionTest.java b/uitest/src/test/java/com/vaadin/tests/components/customlayout/CustomLayoutUpdateCaptionTest.java
new file mode 100644
index 0000000000..c74595d300
--- /dev/null
+++ b/uitest/src/test/java/com/vaadin/tests/components/customlayout/CustomLayoutUpdateCaptionTest.java
@@ -0,0 +1,30 @@
+package com.vaadin.tests.components.customlayout;
+
+import java.util.List;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import com.vaadin.testbench.elements.ButtonElement;
+import com.vaadin.testbench.elements.TextFieldElement;
+import com.vaadin.tests.tb3.SingleBrowserTest;
+
+public class CustomLayoutUpdateCaptionTest extends SingleBrowserTest {
+
+ @Test
+ public void captionUpdated() {
+ openTestURL();
+ List<TextFieldElement> tfs = $(TextFieldElement.class).all();
+ TextFieldElement tf1 = tfs.get(0);
+ TextFieldElement tf2 = tfs.get(1);
+
+ Assert.assertEquals("initial", tf1.getCaption());
+ Assert.assertEquals("initial", tf2.getCaption());
+
+ $(ButtonElement.class).first().click();
+
+ Assert.assertEquals("updated", tf1.getCaption());
+ Assert.assertEquals("updated", tf2.getCaption());
+
+ }
+} \ No newline at end of file
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridSelectionTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridSelectionTest.java
index 25a81984ea..45f7d54ebf 100644
--- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridSelectionTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridSelectionTest.java
@@ -34,6 +34,11 @@ public class GridSelectionTest extends GridBasicsTest {
assertTrue("row should become selected", getRow(0).isSelected());
toggleFirstRowSelection();
assertFalse("row shouldn't remain selected", getRow(0).isSelected());
+
+ toggleFirstRowSelection();
+ assertTrue("row should become selected", getRow(0).isSelected());
+ getGridElement().getCell(0, 0).click();
+ assertFalse("row shouldn't remain selected", getRow(0).isSelected());
}
@Test
@@ -106,6 +111,11 @@ public class GridSelectionTest extends GridBasicsTest {
assertTrue("First row was not selected.", getRow(0).isSelected());
assertTrue("Selection event was not correct", logContainsText(
"SingleSelectionEvent: Selected: DataObject[0]"));
+ grid.getCell(0, 0).click();
+ assertFalse("First row was not deselected.", getRow(0).isSelected());
+ assertTrue("Deselection event was not correct",
+ logContainsText("SingleSelectionEvent: Selected: none"));
+
grid.getCell(5, 0).click();
assertTrue("Fifth row was not selected.", getRow(5).isSelected());
assertFalse("First row was still selected.", getRow(0).isSelected());
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/JavaScriptRenderersTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/JavaScriptRenderersTest.java
index 2cfb65d7ad..9b232cc459 100644
--- a/uitest/src/test/java/com/vaadin/tests/components/grid/JavaScriptRenderersTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/components/grid/JavaScriptRenderersTest.java
@@ -17,7 +17,10 @@ package com.vaadin.tests.components.grid;
import org.junit.Assert;
import org.junit.Test;
+import org.openqa.selenium.WebElement;
+import com.vaadin.testbench.By;
+import com.vaadin.testbench.elements.ButtonElement;
import com.vaadin.testbench.elements.GridElement;
import com.vaadin.testbench.elements.GridElement.GridCellElement;
import com.vaadin.testbench.parallel.TestCategory;
@@ -49,4 +52,20 @@ public class JavaScriptRenderersTest extends MultiBrowserTest {
Assert.assertTrue(
cell_1_1.getText().startsWith("Clicked 1 with key 2 at"));
}
+
+ @Test
+ public void testJavaScriptRendererDestroy() {
+ openTestURL("debug");
+ waitForDebugMessage(
+ "Your JavaScript connector (com_vaadin_tests_components_grid_JavaScriptStringRendererWithDestoryMethod) has a typo. The destory method should be renamed to destroy.");
+
+ $(ButtonElement.class).first().click();
+
+ WebElement log = findElement(By.id("clientLog"));
+ String text = log.getText();
+ Assert.assertTrue(text.contains("destory: 19/3"));
+ Assert.assertTrue(text.contains("destroy: 19/2"));
+ Assert.assertTrue(text.contains("destroy: 0/2"));
+ Assert.assertTrue(text.contains("destory: 0/3"));
+ }
}
diff --git a/uitest/src/test/java/com/vaadin/tests/themes/valo/ModalWindowTest.java b/uitest/src/test/java/com/vaadin/tests/themes/valo/ModalWindowTest.java
index 1d734ffd7a..79ad0ec471 100644
--- a/uitest/src/test/java/com/vaadin/tests/themes/valo/ModalWindowTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/themes/valo/ModalWindowTest.java
@@ -1,10 +1,14 @@
package com.vaadin.tests.themes.valo;
import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
import org.junit.Test;
+import org.openqa.selenium.Keys;
import org.openqa.selenium.WebElement;
+import org.openqa.selenium.interactions.Actions;
import com.vaadin.testbench.By;
import com.vaadin.testbench.elements.ButtonElement;
@@ -31,7 +35,42 @@ public class ModalWindowTest extends SingleBrowserTest {
is("none"));
}
+ @Test
+ public void modal_curtains_close_correctly() {
+ openTestURL();
+
+ openModalWindow();
+ new Actions(getDriver()).moveToElement(findHeaderElement())
+ .clickAndHold().moveByOffset(1, 1).perform();
+ assertTrue(isElementPresent(By.className("v-window-draggingCurtain")));
+ new Actions(getDriver()).sendKeys(findHeaderElement(), Keys.ESCAPE)
+ .release().perform();
+ verifyCurtainsNotPresent();
+
+ openModalWindow();
+ new Actions(getDriver()).moveToElement(findResizingElement())
+ .clickAndHold().moveByOffset(1, 1).perform();
+ assertTrue(isElementPresent(By.className("v-window-resizingCurtain")));
+ new Actions(getDriver()).sendKeys(findResizingElement(), Keys.ESCAPE)
+ .release().perform();
+ verifyCurtainsNotPresent();
+ }
+
private void openModalWindow() {
$(ButtonElement.class).get(1).click();
}
-}
+
+ private WebElement findHeaderElement() {
+ return findElement(By.className("v-window-header"));
+ }
+
+ private WebElement findResizingElement() {
+ return findElement(By.className("v-window-resizebox"));
+ }
+
+ private void verifyCurtainsNotPresent() {
+ assertFalse(isElementPresent(By.className("v-window-modalitycurtain")));
+ assertFalse(isElementPresent(By.className("v-window-draggingCurtain")));
+ assertFalse(isElementPresent(By.className("v-window-resizingCurtain")));
+ }
+} \ No newline at end of file
diff --git a/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/GridBasicFeaturesTest.java b/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/GridBasicFeaturesTest.java
index 04bb29c5c8..7c4a5962f2 100644
--- a/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/GridBasicFeaturesTest.java
+++ b/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/GridBasicFeaturesTest.java
@@ -251,4 +251,8 @@ public abstract class GridBasicFeaturesTest extends MultiBrowserTest {
}
return null;
}
+
+ protected void toggleColumnHidden(int column) {
+ selectMenuPath("Component", "Columns", "Column " + column, "Hidden");
+ }
}
diff --git a/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/server/GridColumnReorderTest.java b/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/server/GridColumnReorderTest.java
index feac52c0d3..aac48dc4d2 100644
--- a/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/server/GridColumnReorderTest.java
+++ b/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/server/GridColumnReorderTest.java
@@ -209,6 +209,29 @@ public class GridColumnReorderTest extends GridBasicFeaturesTest {
}
@Test
+ public void testColumnReorder_draggingFrozenColumnsContainingHiddenColumns_impossible() {
+ // given
+ openTestURL();
+ selectMenuPath("Component", "Size", "Width", "900px");
+ toggleColumnReordering();
+ setFrozenColumns(4);
+ toggleColumnHidden(1);
+ toggleColumnHidden(2);
+ assertColumnHeaderOrder(0, 3, 4, 5);
+
+ // when
+ // drag frozen column out between non-frozen columns
+ dragAndDropDefaultColumnHeader(1, 2, CellSide.RIGHT);
+
+ // then
+ // everything should be as before
+ assertColumnHeaderOrder(0, 3, 4, 5);
+ assertTrue(getGridElement().getHeaderCell(0, 0).isFrozen());
+ assertTrue(getGridElement().getHeaderCell(0, 1).isFrozen());
+ assertFalse(getGridElement().getHeaderCell(0, 2).isFrozen());
+ }
+
+ @Test
public void testColumnReorder_draggingColumnOnTopOfFrozenColumn_columnDroppedRightOfFrozenColumns() {
// given
openTestURL();
diff --git a/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/server/GridColumnResizeTest.java b/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/server/GridColumnResizeTest.java
index fda42e7739..14738bfa57 100644
--- a/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/server/GridColumnResizeTest.java
+++ b/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/server/GridColumnResizeTest.java
@@ -153,13 +153,13 @@ public class GridColumnResizeTest extends GridBasicFeaturesTest {
selectMenuPath("Component", "Columns",
"Toggle all column hidden state");
// Hides although already hidden
- selectMenuPath("Component", "Columns", "Column 0", "Hidden");
+ toggleColumnHidden(0);
// Shows
- selectMenuPath("Component", "Columns", "Column 0", "Hidden");
+ toggleColumnHidden(0);
// Hides although already hidden
- selectMenuPath("Component", "Columns", "Column 2", "Hidden");
+ toggleColumnHidden(2);
// Shows
- selectMenuPath("Component", "Columns", "Column 2", "Hidden");
+ toggleColumnHidden(2);
GridCellElement cell = getGridElement().getCell(0, 1);
dragResizeColumn(1, 0, -cell.getSize().getWidth());
assertGreaterOrEqual("Cell got too small.", cell.getSize().getWidth(),
diff --git a/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/server/GridKeyboardNavigationTest.java b/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/server/GridKeyboardNavigationTest.java
index 6878a36bd5..2c03964d81 100644
--- a/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/server/GridKeyboardNavigationTest.java
+++ b/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/server/GridKeyboardNavigationTest.java
@@ -229,4 +229,17 @@ public class GridKeyboardNavigationTest extends GridBasicFeaturesTest {
column == focusedColumn
&& Math.abs(row - focusedRow) <= rowTolerance);
}
+
+ @Test
+ public void testNavigateOverHiddenColumnToFrozenColumn() {
+ openTestURL();
+ setFrozenColumns(3);
+ toggleColumnHidden(1);
+ getGridElement().getCell(0, 2).click();
+ assertFocusedCell(0, 2);
+ new Actions(getDriver()).sendKeys(Keys.ARROW_LEFT).perform();
+ assertFocusedCell(0, 1);
+ new Actions(getDriver()).sendKeys(Keys.ARROW_LEFT).perform();
+ assertFocusedCell(0, 0);
+ }
}