summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorHenrik Paul <henrik@vaadin.com>2015-03-24 15:11:23 +0200
committerVaadin Code Review <review@vaadin.com>2015-03-25 14:03:22 +0000
commit6a7437cc96da860e50297e064abe7aef387c9e2c (patch)
tree5031b0eccb298de0dbf7d27cb264fdea5f64ada1 /uitest
parentff5f4e29731e534a85c5c22fab292eea0476237b (diff)
downloadvaadin-framework-6a7437cc96da860e50297e064abe7aef387c9e2c.tar.gz
vaadin-framework-6a7437cc96da860e50297e064abe7aef387c9e2c.zip
Fixes edge case in null details generation for Grid (#17274)
Change-Id: I1bf4c2f0600baea8b925bd31dcd42c1e901a7c8b
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridDetailsServerTest.java26
1 files changed, 24 insertions, 2 deletions
diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridDetailsServerTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridDetailsServerTest.java
index 7ddd903161..cfaf79ea05 100644
--- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridDetailsServerTest.java
+++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridDetailsServerTest.java
@@ -81,6 +81,22 @@ public class GridDetailsServerTest extends GridBasicFeaturesTest {
}
@Test
+ public void openVisiblePopulatedDetails() {
+ selectMenuPath(DETAILS_GENERATOR_WATCHING);
+ selectMenuPath(OPEN_FIRST_ITEM_DETAILS);
+ assertNotNull("details should've populated", getGridElement()
+ .getDetails(0).findElement(By.className("v-widget")));
+ }
+
+ @Test(expected = NoSuchElementException.class)
+ public void closeVisiblePopulatedDetails() {
+ selectMenuPath(DETAILS_GENERATOR_WATCHING);
+ selectMenuPath(OPEN_FIRST_ITEM_DETAILS);
+ selectMenuPath(OPEN_FIRST_ITEM_DETAILS);
+ getGridElement().getDetails(0);
+ }
+
+ @Test
public void openDetailsOutsideOfActiveRange() throws InterruptedException {
getGridElement().scroll(10000);
selectMenuPath(OPEN_FIRST_ITEM_DETAILS);
@@ -260,8 +276,14 @@ public class GridDetailsServerTest extends GridBasicFeaturesTest {
selectMenuPath(OPEN_FIRST_ITEM_DETAILS);
selectMenuPath(DETAILS_GENERATOR_WATCHING);
selectMenuPath(DETAILS_GENERATOR_NULL);
- assertTrue("Details should be empty with null component",
- getGridElement().getDetails(0).getText().isEmpty());
+
+ try {
+ assertTrue("Details should be empty with null component",
+ getGridElement().getDetails(0).getText().isEmpty());
+ } catch (NoSuchElementException e) {
+ fail("Expected to find a details row with empty content");
+ }
+
selectMenuPath(DETAILS_GENERATOR_WATCHING);
assertFalse("Details should be not empty with details component",
getGridElement().getDetails(0).getText().isEmpty());