aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src
diff options
context:
space:
mode:
authorFabian Lange <lange.fabian@gmail.com>2014-07-01 13:31:08 +0200
committerSauli Tähkäpää <sauli@vaadin.com>2014-07-01 15:48:30 +0300
commit0ceccae58fb7fbeac867b79766e3bf8296d9e075 (patch)
tree0f403aabc9890d0ffcff231067ea94b6c5a9c7a2 /uitest/src
parent264e617c58d537d12a03b5f3fb73f5129fcadc09 (diff)
downloadvaadin-framework-0ceccae58fb7fbeac867b79766e3bf8296d9e075.tar.gz
vaadin-framework-0ceccae58fb7fbeac867b79766e3bf8296d9e075.zip
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
Diffstat (limited to 'uitest/src')
-rw-r--r--uitest/src/com/vaadin/tests/components/window/WindowMoveListenerTest.java26
1 files changed, 16 insertions, 10 deletions
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<Boolean>() {
+ @Override
+ public Boolean apply(WebDriver input) {
+ return winPos.x == window.getLocation().x &&
+ winPos.y == window.getLocation().y;
+ }
+ }, 5);
}
}