OpenQA.Selenium.RenderedWebElementTest.ShouldAllowUsersToHoverOverElements C# (CSharp) Méthode

ShouldAllowUsersToHoverOverElements() private méthode

private ShouldAllowUsersToHoverOverElements ( ) : void
Résultat void
        public void ShouldAllowUsersToHoverOverElements()
        {
            driver.Url = javascriptPage;

            IWebElement element = driver.FindElement(By.Id("menu1"));
            if (!Platform.CurrentPlatform.IsPlatformType(PlatformType.Windows))
            {
                Assert.Ignore("Skipping test: Simulating hover needs native events");
            }

            IHasInputDevices inputDevicesDriver = driver as IHasInputDevices;
            if (inputDevicesDriver == null)
            {
                return;
            }

            IWebElement item = driver.FindElement(By.Id("item1"));
            Assert.AreEqual("", item.Text);

            ((IJavaScriptExecutor)driver).ExecuteScript("arguments[0].style.background = 'green'", element);
            //element.Hover();
            Actions actionBuilder = new Actions(driver);
            actionBuilder.MoveToElement(element).Perform();

            item = driver.FindElement(By.Id("item1"));
            Assert.AreEqual("Item 1", item.Text);
        }