|
25 | 25 | import static org.openqa.selenium.WaitingConditions.elementTextToContain;
|
26 | 26 | import static org.openqa.selenium.WaitingConditions.elementTextToEqual;
|
27 | 27 | import static org.openqa.selenium.WaitingConditions.elementValueToEqual;
|
28 |
| -import static org.openqa.selenium.ie.InternetExplorerDriver.ENABLE_PERSISTENT_HOVERING; |
29 | 28 | import static org.openqa.selenium.support.ui.ExpectedConditions.not;
|
30 | 29 | import static org.openqa.selenium.support.ui.ExpectedConditions.titleIs;
|
31 | 30 | import static org.openqa.selenium.testing.Ignore.Driver.CHROME;
|
32 | 31 | import static org.openqa.selenium.testing.Ignore.Driver.FIREFOX;
|
33 | 32 | import static org.openqa.selenium.testing.Ignore.Driver.HTMLUNIT;
|
34 | 33 | import static org.openqa.selenium.testing.Ignore.Driver.IE;
|
35 | 34 | import static org.openqa.selenium.testing.Ignore.Driver.MARIONETTE;
|
36 |
| -import static org.openqa.selenium.testing.Ignore.Driver.PHANTOMJS; |
37 | 35 | import static org.openqa.selenium.testing.Ignore.Driver.REMOTE;
|
38 | 36 | import static org.openqa.selenium.testing.Ignore.Driver.SAFARI;
|
39 | 37 | import static org.openqa.selenium.testing.TestUtilities.isFirefox;
|
|
51 | 49 | import org.openqa.selenium.Platform;
|
52 | 50 | import org.openqa.selenium.WebDriver;
|
53 | 51 | import org.openqa.selenium.WebElement;
|
54 |
| -import org.openqa.selenium.remote.DesiredCapabilities; |
55 | 52 | import org.openqa.selenium.support.Color;
|
56 | 53 | import org.openqa.selenium.support.Colors;
|
57 | 54 | import org.openqa.selenium.support.ui.ExpectedCondition;
|
58 | 55 | import org.openqa.selenium.testing.Ignore;
|
59 | 56 | import org.openqa.selenium.testing.JUnit4TestBase;
|
60 | 57 | import org.openqa.selenium.testing.JavascriptEnabled;
|
61 |
| -import org.openqa.selenium.testing.NeedsLocalEnvironment; |
62 | 58 | import org.openqa.selenium.testing.NotYetImplemented;
|
63 | 59 | import org.openqa.selenium.testing.TestUtilities;
|
64 |
| -import org.openqa.selenium.testing.drivers.WebDriverBuilder; |
65 | 60 |
|
66 |
| -import java.awt.*; |
67 | 61 | import java.util.Map;
|
68 | 62 |
|
69 | 63 | /**
|
@@ -451,55 +445,6 @@ public void testHoverPersists() throws Exception {
|
451 | 445 | assertEquals("Item 1", item.getText());
|
452 | 446 | }
|
453 | 447 |
|
454 |
| - @JavascriptEnabled |
455 |
| - @Ignore( |
456 |
| - value = {FIREFOX, CHROME, SAFARI, PHANTOMJS, MARIONETTE}, |
457 |
| - reason = "This is an IE only tests") |
458 |
| - @NotYetImplemented(HTMLUNIT) |
459 |
| - @NoDriverAfterTest |
460 |
| - @NeedsLocalEnvironment |
461 |
| - @Test |
462 |
| - public void testPersistentHoverCanBeTurnedOff() throws Exception { |
463 |
| - assumeTrue(TestUtilities.isInternetExplorer(driver)); |
464 |
| - // Destroy the previous driver to make sure the hovering thread is |
465 |
| - // stopped. |
466 |
| - driver.quit(); |
467 |
| - |
468 |
| - DesiredCapabilities caps = new DesiredCapabilities(); |
469 |
| - caps.setCapability(ENABLE_PERSISTENT_HOVERING, false); |
470 |
| - WebDriverBuilder builder = new WebDriverBuilder().setDesiredCapabilities(caps); |
471 |
| - driver = builder.get(); |
472 |
| - |
473 |
| - try { |
474 |
| - driver.get(pages.javascriptPage); |
475 |
| - // Move to a different element to make sure the mouse is not over the |
476 |
| - // element with id 'item1' (from a previous test). |
477 |
| - new Actions(driver).moveToElement(driver.findElement(By.id("keyUp"))).build().perform(); |
478 |
| - WebElement element = driver.findElement(By.id("menu1")); |
479 |
| - |
480 |
| - final WebElement item = driver.findElement(By.id("item1")); |
481 |
| - assertEquals("", item.getText()); |
482 |
| - |
483 |
| - ((JavascriptExecutor) driver).executeScript("arguments[0].style.background = 'green'", element); |
484 |
| - new Actions(driver).moveToElement(element).build().perform(); |
485 |
| - |
486 |
| - // Move the mouse somewhere - to make sure that the thread firing the events making |
487 |
| - // hover persistent is not active. |
488 |
| - Robot robot = new Robot(); |
489 |
| - robot.mouseMove(50, 50); |
490 |
| - |
491 |
| - // Intentionally wait to make sure hover DOES NOT persist. |
492 |
| - Thread.sleep(1000); |
493 |
| - |
494 |
| - wait.until(elementTextToEqual(item, "")); |
495 |
| - |
496 |
| - assertEquals("", item.getText()); |
497 |
| - |
498 |
| - } finally { |
499 |
| - driver.quit(); |
500 |
| - } |
501 |
| - } |
502 |
| - |
503 | 448 | @JavascriptEnabled
|
504 | 449 | @Ignore(value = {SAFARI, MARIONETTE},
|
505 | 450 | reason = "Advanced mouse actions only implemented in rendered browsers",
|
|
0 commit comments