From 346d4897d185aa21ef18637884b13df82b4a2aa2 Mon Sep 17 00:00:00 2001 From: Jim Evans Date: Fri, 31 Aug 2018 07:59:27 -0700 Subject: [PATCH] Adding .NET test for click on scrolled element with text and children Adding a test that clicks on an element that must be scrolled into view where the element has text, but also has child elements. --- dotnet/test/common/ClickScrollingTest.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/dotnet/test/common/ClickScrollingTest.cs b/dotnet/test/common/ClickScrollingTest.cs index e608fd78e64e3..9c401822ca5cb 100644 --- a/dotnet/test/common/ClickScrollingTest.cs +++ b/dotnet/test/common/ClickScrollingTest.cs @@ -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( + "
Force scroll needed
")); + 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;");