Skip to content

Commit

Permalink
Adding IE-specific test for element obscured by invisible element in …
Browse files Browse the repository at this point in the history
…z-order
  • Loading branch information
jimevans committed Mar 23, 2018
1 parent 2c4f935 commit 61d741b
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
26 changes: 26 additions & 0 deletions common/src/web/elementObscuredByInvisibleElement.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="UTF-8">
<title>Selenium Test</title>
</head>
<body>
<a id="gLink" href="https://www.google.com">Google</a>
<div style="visibility: hidden; width: 400px; height:250px; border: 0px solid blue; position: absolute; left: 0; top: 0; z-index: 100001;">
<table style="width:400px;height:250px; border:1px solid black; margin:0; background-color:white">
<tbody><tr>
<td>
<table valign="top" style="border-top:1px solid #E9F6FF;border-left:1px solid #E9F6FF; border-bottom:1px solid #3E5F80; width: 100%;">
<tbody><tr>
<td> Login </td>
</tr>
</tbody></table>
</td>
</tr>
<tr><td style="background: #778CA5;">&nbsp;</td></tr>
<tr><td style="width:15px;height:15px; background: #778CA5;">&nbsp;</td></tr>
</tbody></table>
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion dotnet/IE Tests.playlist
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<Playlist Version="1.0"><Add Test="OpenQA.Selenium.IE.IeSpecificTests.AlertSelectTest" /><Add Test="OpenQA.Selenium.IE.IeSpecificTests.KeysTest" /><Add Test="OpenQA.Selenium.IE.IeSpecificTests.ScrollTest" /><Add Test="OpenQA.Selenium.IE.IeSpecificTests.ScrollingFrameTest" /><Add Test="OpenQA.Selenium.IE.IeSpecificTests.InputOnChangeAlert" /><Add Test="OpenQA.Selenium.IE.IeSpecificTests.ShouldNotScrollIfAlreadyScrolledAndElementIsInView" /><Add Test="OpenQA.Selenium.IE.IeSpecificTests.ShouldBeAbleToStartMoreThanOneInstanceOfTheIEDriverSimultaneously" /><Add Test="OpenQA.Selenium.IE.IeSpecificTests.ShouldHandleShowModalDialogWindows" /><Add Test="OpenQA.Selenium.IE.IeSpecificTests.ShouldBeAbleToBrowseTransformedXml" /><Add Test="OpenQA.Selenium.IE.IeSpecificTests.ShouldBeAbleToHandleCascadingModalDialogsLaunchedWithJavaScriptLinks" /><Add Test="OpenQA.Selenium.IE.IeSpecificTests.ShouldNotScrollOverflowElementsWhichAreVisible" /><Add Test="OpenQA.Selenium.IE.IeSpecificTests.ShouldPropagateSessionCookies" /><Add Test="OpenQA.Selenium.IE.IeSpecificTests.ShouldBeAbleToHandleCascadingModalDialogs" /></Playlist>
<Playlist Version="1.0"><Add Test="OpenQA.Selenium.IE.IeSpecificTests.AlertSelectTest" /><Add Test="OpenQA.Selenium.IE.IeSpecificTests.KeysTest" /><Add Test="OpenQA.Selenium.IE.IeSpecificTests.ScrollTest" /><Add Test="OpenQA.Selenium.IE.IeSpecificTests.ScrollingFrameTest" /><Add Test="OpenQA.Selenium.IE.IeSpecificTests.InputOnChangeAlert" /><Add Test="OpenQA.Selenium.IE.IeSpecificTests.ShouldNotScrollIfAlreadyScrolledAndElementIsInView" /><Add Test="OpenQA.Selenium.IE.IeSpecificTests.ShouldBeAbleToStartMoreThanOneInstanceOfTheIEDriverSimultaneously" /><Add Test="OpenQA.Selenium.IE.IeSpecificTests.ShouldHandleShowModalDialogWindows" /><Add Test="OpenQA.Selenium.IE.IeSpecificTests.ShouldBeAbleToBrowseTransformedXml" /><Add Test="OpenQA.Selenium.IE.IeSpecificTests.ShouldBeAbleToHandleCascadingModalDialogsLaunchedWithJavaScriptLinks" /><Add Test="OpenQA.Selenium.IE.IeSpecificTests.ShouldNotScrollOverflowElementsWhichAreVisible" /><Add Test="OpenQA.Selenium.IE.IeSpecificTests.ShouldPropagateSessionCookies" /><Add Test="OpenQA.Selenium.IE.IeSpecificTests.ShouldBeAbleToHandleCascadingModalDialogs" /><Add Test="OpenQA.Selenium.IE.IeSpecificTests.TestInvisibleZOrder" /></Playlist>
8 changes: 8 additions & 0 deletions dotnet/test/ie/IeSpecificTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,14 @@ public void ShouldBeAbleToHandleCascadingModalDialogsLaunchedWithJavaScriptLinks
driver.SwitchTo().Window(parentHandle);
}

[Test]
public void TestInvisibleZOrder()
{
driver.Url = EnvironmentManager.Instance.UrlBuilder.WhereIs("elementObscuredByInvisibleElement.html");
IWebElement element = driver.FindElement(By.CssSelector("#gLink"));
element.Click();
}

private long GetScrollTop()
{
return (long)((IJavaScriptExecutor)driver).ExecuteScript("return document.body.scrollTop;");
Expand Down

0 comments on commit 61d741b

Please sign in to comment.