]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fix NestedLayoutCaptionHoverTest to work with TB 3.1.3
authorTeemu Suo-Anttila <teemusa@vaadin.com>
Thu, 6 Mar 2014 12:49:54 +0000 (14:49 +0200)
committerVaadin Code Review <review@vaadin.com>
Thu, 6 Mar 2014 12:57:49 +0000 (12:57 +0000)
Change-Id: Ief75a235f8563f9664dd82c9c5a1aab38c7bc77d

uitest/src/com/vaadin/tests/components/orderedlayout/NestedLayoutCaptionHoverTest.java

index 95a2c9f49342bb24626dc9127f1aa86be602cc68..24a27f343a5f4bef7a293fba4b63d0c5f0825647 100644 (file)
 package com.vaadin.tests.components.orderedlayout;
 
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 import org.junit.Test;
 import org.openqa.selenium.By;
+import org.openqa.selenium.NoSuchElementException;
 import org.openqa.selenium.WebElement;
 import org.openqa.selenium.interactions.HasInputDevices;
 import org.openqa.selenium.interactions.internal.Coordinates;
@@ -46,9 +48,14 @@ public class NestedLayoutCaptionHoverTest extends MultiBrowserTest {
         ((HasInputDevices) getDriver()).getMouse().mouseMove(coords);
         sleep(1000);
 
-        // Verify that there's no error notification
-        WebElement error = vaadinElement("Root/VNotification[0]");
-        assertNull("No error should be found", error);
+        String selector = "Root/VNotification[0]";
+        try {
+            // Verify that there's no error notification
+            vaadinElement(selector);
+            fail("No error notification should be found");
+        } catch (NoSuchElementException e) {
+            // Exception caught. Verify it's the right one.
+            assertTrue(e.getMessage().contains(selector));
+        }
     }
-
 }