]> source.dussan.org Git - vaadin-framework.git/commitdiff
Make test work on all browsers (#13775)
authorArtur Signell <artur@vaadin.com>
Thu, 5 Feb 2015 09:57:47 +0000 (11:57 +0200)
committerVaadin Code Review <review@vaadin.com>
Thu, 5 Feb 2015 11:27:32 +0000 (11:27 +0000)
Change-Id: I282b3d5b14a5ec09060491bd9833c76f061bbf56

uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorTest.java
uitest/src/com/vaadin/tests/tb3/newelements/FixedNotificationElement.java [new file with mode: 0644]

index 61dbfbc7c93602c90864c209a1f49619ec6cac9e..994b2e8e2eddb90323cecdab79591ec4d20ee381 100644 (file)
@@ -38,6 +38,7 @@ import com.vaadin.testbench.elements.GridElement.GridEditorElement;
 import com.vaadin.testbench.elements.NotificationElement;
 import com.vaadin.tests.components.grid.basicfeatures.GridBasicFeatures;
 import com.vaadin.tests.components.grid.basicfeatures.GridBasicFeaturesTest;
+import com.vaadin.tests.tb3.newelements.FixedNotificationElement;
 
 public class GridEditorTest extends GridBasicFeaturesTest {
 
@@ -215,9 +216,9 @@ public class GridEditorTest extends GridBasicFeaturesTest {
         intField.clear();
         intField.sendKeys("banana phone");
         editor.save();
-        WebElement n = $(NotificationElement.class).first();
+        FixedNotificationElement n = $(FixedNotificationElement.class).first();
         assertEquals("Column 7: Could not convert value to Integer",
-                n.getText());
+                n.getCaption());
         n.click();
         editor.cancel();
 
diff --git a/uitest/src/com/vaadin/tests/tb3/newelements/FixedNotificationElement.java b/uitest/src/com/vaadin/tests/tb3/newelements/FixedNotificationElement.java
new file mode 100644 (file)
index 0000000..db20016
--- /dev/null
@@ -0,0 +1,16 @@
+package com.vaadin.tests.tb3.newelements;
+
+import org.openqa.selenium.WebElement;
+
+import com.vaadin.testbench.By;
+import com.vaadin.testbench.elements.NotificationElement;
+import com.vaadin.testbench.elements.ServerClass;
+
+@ServerClass("com.vaadin.ui.Notification")
+public class FixedNotificationElement extends NotificationElement {
+    public String getCaption() {
+        WebElement popup = findElement(By.className("popupContent"));
+        WebElement caption = popup.findElement(By.tagName("h1"));
+        return caption.getText();
+    }
+}