summaryrefslogtreecommitdiffstats
path: root/uitest/src/com
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <teemusa@vaadin.com>2016-01-22 14:23:55 +0200
committerHenri Sara <hesara@vaadin.com>2016-02-13 13:09:52 +0000
commitd004aa1f8bbcc30ab58663b29c4945116256bb53 (patch)
treec39bd4058af4543bd3abeaddd857a490a65477f4 /uitest/src/com
parentae0d2bd61cb82a524e4ef810de21f0bc72aecc93 (diff)
downloadvaadin-framework-d004aa1f8bbcc30ab58663b29c4945116256bb53.tar.gz
vaadin-framework-d004aa1f8bbcc30ab58663b29c4945116256bb53.zip
Fix Components cleanup on Header/FooterRow remove in Grid (#19497)
Change-Id: I596d0cc13b782398b4c5c8338b8370e69862ea88
Diffstat (limited to 'uitest/src/com')
-rw-r--r--uitest/src/com/vaadin/tests/components/grid/GridHeaderFooterComponentsTest.java41
1 files changed, 39 insertions, 2 deletions
diff --git a/uitest/src/com/vaadin/tests/components/grid/GridHeaderFooterComponentsTest.java b/uitest/src/com/vaadin/tests/components/grid/GridHeaderFooterComponentsTest.java
index 977b16cebd..e8d3abf42d 100644
--- a/uitest/src/com/vaadin/tests/components/grid/GridHeaderFooterComponentsTest.java
+++ b/uitest/src/com/vaadin/tests/components/grid/GridHeaderFooterComponentsTest.java
@@ -15,11 +15,15 @@
*/
package com.vaadin.tests.components.grid;
+import static org.junit.Assert.assertFalse;
+
import java.util.List;
import org.junit.Assert;
+import org.junit.Before;
import org.junit.Test;
+import com.vaadin.testbench.By;
import com.vaadin.testbench.elements.ButtonElement;
import com.vaadin.testbench.elements.GridElement;
import com.vaadin.testbench.elements.GridElement.GridCellElement;
@@ -28,9 +32,15 @@ import com.vaadin.tests.tb3.SingleBrowserTest;
public class GridHeaderFooterComponentsTest extends SingleBrowserTest {
+ @Before
+ public void setUp() {
+ setDebug(true);
+
+ openTestURL();
+ }
+
@Test
public void hideAndShowComponentsInHeader() {
- openTestURL();
GridElement grid = $(GridElement.class).first();
int filterRow = 2;
@@ -48,6 +58,8 @@ public class GridHeaderFooterComponentsTest extends SingleBrowserTest {
textfield.setValue("foo");
Assert.assertEquals("1. value change for field in string to foo",
getLogRow(0));
+
+ assertNoErrorNotifications();
}
private TextFieldElement getHeaderElement(GridElement grid, int row, int col) {
@@ -66,7 +78,6 @@ public class GridHeaderFooterComponentsTest extends SingleBrowserTest {
@Test
public void hideAndShowComponentsInFooter() {
- openTestURL();
GridElement grid = $(GridElement.class).first();
int filterRow = 0;
@@ -84,6 +95,8 @@ public class GridHeaderFooterComponentsTest extends SingleBrowserTest {
textfield.setValue("foo");
Assert.assertEquals("1. value change for field in string to foo",
getLogRow(0));
+
+ assertNoErrorNotifications();
}
private TextFieldElement getFooterElement(GridElement grid, int row, int col) {
@@ -100,4 +113,28 @@ public class GridHeaderFooterComponentsTest extends SingleBrowserTest {
}
}
+ @Test
+ public void testRemoveAllHeadersAndFooters() {
+ openTestURL();
+
+ for (int i = 2; i >= 0; --i) {
+ // Remove Header
+ $(GridElement.class).first().getHeaderCell(i, 0)
+ .$(ButtonElement.class).first().click();
+ assertFalse(
+ "Header " + i + " should not be present.",
+ $(GridElement.class).first().isElementPresent(
+ By.vaadin("#header[" + i + "]")));
+
+ // Remove Footer
+ $(GridElement.class).first().getFooterCell(i, 0)
+ .$(ButtonElement.class).first().click();
+ assertFalse(
+ "Footer " + i + " should not be present.",
+ $(GridElement.class).first().isElementPresent(
+ By.vaadin("#footer[" + i + "]")));
+ }
+
+ assertNoErrorNotifications();
+ }
}