You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

WindowShadowTest.java 1.2KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package com.vaadin.tests.components.window;
  2. import java.awt.AWTException;
  3. import java.io.IOException;
  4. import org.junit.Test;
  5. import org.openqa.selenium.By;
  6. import org.openqa.selenium.Point;
  7. import org.openqa.selenium.WebElement;
  8. import org.openqa.selenium.interactions.Actions;
  9. import com.vaadin.tests.tb3.MultiBrowserTest;
  10. public class WindowShadowTest extends MultiBrowserTest {
  11. @Test
  12. public void dragBackgroundWindow()
  13. throws AWTException, IOException, InterruptedException {
  14. openTestURL();
  15. WebElement wnd = getDriver().findElement(By.id("topwindow"));
  16. // There is some bug in Selenium. Can't move window using header
  17. // need use footer instead.
  18. WebElement wnd1Footer = wnd
  19. .findElement(By.className("v-window-footer"));
  20. Point startLoc = wnd.getLocation();
  21. new Actions(getDriver()).moveToElement(wnd1Footer).clickAndHold()
  22. .moveByOffset(200, 200).release().perform();
  23. Point endLoc = wnd.getLocation();
  24. // don't compare to specific coordinate, because in IE9 and IE11
  25. // the window position is random.
  26. // So, checkt that the window was moved
  27. org.junit.Assert.assertNotEquals(startLoc, endLoc);
  28. }
  29. }