From 0ceccae58fb7fbeac867b79766e3bf8296d9e075 Mon Sep 17 00:00:00 2001 From: Fabian Lange Date: Tue, 1 Jul 2014 13:31:08 +0200 Subject: Reading properties of components should not set state to dirty (#14060). Fixed issue with SplitPanels which were not marking sets as dirty. Change-Id: I23bb8bfca87a825aef132f249e05871cf7b36a34 --- .../components/window/WindowMoveListenerTest.java | 26 +++++++++++++--------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'uitest/src') diff --git a/uitest/src/com/vaadin/tests/components/window/WindowMoveListenerTest.java b/uitest/src/com/vaadin/tests/components/window/WindowMoveListenerTest.java index 5502bf0495..a2b5e0f139 100644 --- a/uitest/src/com/vaadin/tests/components/window/WindowMoveListenerTest.java +++ b/uitest/src/com/vaadin/tests/components/window/WindowMoveListenerTest.java @@ -1,16 +1,16 @@ package com.vaadin.tests.components.window; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; - +import com.vaadin.tests.tb3.MultiBrowserTest; import org.junit.Test; import org.openqa.selenium.By; import org.openqa.selenium.Point; +import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.interactions.Action; import org.openqa.selenium.interactions.Actions; +import org.openqa.selenium.support.ui.ExpectedCondition; -import com.vaadin.tests.tb3.MultiBrowserTest; +import static org.junit.Assert.assertNotEquals; public class WindowMoveListenerTest extends MultiBrowserTest { @@ -18,7 +18,7 @@ public class WindowMoveListenerTest extends MultiBrowserTest { public void testWindowRepositioning() throws Exception { openTestURL(); - WebElement window = getDriver().findElement(By.id("testwindow")); + final WebElement window = getDriver().findElement(By.id("testwindow")); WebElement button = getDriver().findElement(By.id("testbutton")); // I'd loved to use the header, but that doesn't work. Footer works @@ -26,7 +26,7 @@ public class WindowMoveListenerTest extends MultiBrowserTest { WebElement windowHeader = getDriver().findElement( By.className("v-window-footer")); - Point winPos = window.getLocation(); + final Point winPos = window.getLocation(); // move window Action a = new Actions(driver).clickAndHold(windowHeader) @@ -41,10 +41,16 @@ public class WindowMoveListenerTest extends MultiBrowserTest { // re-set window button.click(); - assertEquals("Window was not re-positioned correctly.", winPos.x, - window.getLocation().x); - assertEquals("Window was not re-positioned correctly.", winPos.y, - window.getLocation().y); + waitUntilWindowHasReseted(window, winPos); + } + private void waitUntilWindowHasReseted(final WebElement window, final Point winPos) { + waitUntil(new ExpectedCondition() { + @Override + public Boolean apply(WebDriver input) { + return winPos.x == window.getLocation().x && + winPos.y == window.getLocation().y; + } + }, 5); } } -- cgit v1.2.3