]> source.dussan.org Git - vaadin-framework.git/commitdiff
Close notification correctly in GridEditorTest
authorTeemu Suo-Anttila <teemusa@vaadin.com>
Thu, 5 Feb 2015 11:20:38 +0000 (13:20 +0200)
committerVaadin Code Review <review@vaadin.com>
Thu, 5 Feb 2015 12:22:34 +0000 (12:22 +0000)
Change-Id: Ibe5f1cab99025fa4760ebd1e6b9d11d739e1a435

uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorTest.java
uitest/src/com/vaadin/tests/tb3/newelements/FixedNotificationElement.java

index 994b2e8e2eddb90323cecdab79591ec4d20ee381..566946a7eaebed6e09e4b19684bc1c7ce2ae6870 100644 (file)
@@ -219,7 +219,7 @@ public class GridEditorTest extends GridBasicFeaturesTest {
         FixedNotificationElement n = $(FixedNotificationElement.class).first();
         assertEquals("Column 7: Could not convert value to Integer",
                 n.getCaption());
-        n.click();
+        n.close();
         editor.cancel();
 
         selectMenuPath(EDIT_ITEM_100);
index db200164868522f2a7931772c3ae3c3698327dbf..ff7715e281bc924278a02aa4543cdf5579f52bed 100644 (file)
@@ -1,6 +1,8 @@
 package com.vaadin.tests.tb3.newelements;
 
 import org.openqa.selenium.WebElement;
+import org.openqa.selenium.support.ui.ExpectedConditions;
+import org.openqa.selenium.support.ui.WebDriverWait;
 
 import com.vaadin.testbench.By;
 import com.vaadin.testbench.elements.NotificationElement;
@@ -13,4 +15,11 @@ public class FixedNotificationElement extends NotificationElement {
         WebElement caption = popup.findElement(By.tagName("h1"));
         return caption.getText();
     }
+
+    public void close() {
+        click();
+        WebDriverWait wait = new WebDriverWait(getDriver(), 10);
+        wait.until(ExpectedConditions.not(ExpectedConditions
+                .presenceOfAllElementsLocatedBy(By.className("v-Notification"))));
+    }
 }