Skip to content

Commit

Permalink
Adding .NET test for click on scrolled element with text and children
Browse files Browse the repository at this point in the history
Adding a test that clicks on an element that must be scrolled into view
where the element has text, but also has child elements.
  • Loading branch information
jimevans committed Sep 8, 2018
1 parent ec174bb commit 346d489
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions dotnet/test/common/ClickScrollingTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,21 @@ public void ShouldBeAbleToClickElementInATallFrame()
Assert.That(element.Selected, "Element is not selected");
}

//------------------------------------------------------------------
// Tests below here are not included in the Java test suite
//------------------------------------------------------------------
[Test]
public void ShouldBeAbleToClickInlineTextElementWithChildElementAfterScrolling()
{
driver.Url = EnvironmentManager.Instance.UrlBuilder.CreateInlinePage(new InlinePage()
.WithBody(
"<div style='height: 2000px;'>Force scroll needed</div><label id='wrapper'>wraps a checkbox <input id='check' type='checkbox' checked='checked'/></label>"));
IWebElement label = driver.FindElement(By.Id("wrapper"));
label.Click();
IWebElement checkbox = driver.FindElement(By.Id("check"));
Assert.IsFalse(checkbox.Selected, "Checkbox should not be selected after click");
}

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

0 comments on commit 346d489

Please sign in to comment.