コード例 #1
0
        public void TestScriptText()
        {
            WebDriver.Setup(x => x.ExecuteScript(It.IsAny <string>(), It.IsAny <object[]>())).Returns("textContent");

            Actor.Calls(JavaScriptText.Of(Locator)).Should().Be("textContent");
            Logger.Messages.Should().ContainMatch("*JavaScript code to execute:");
            Logger.Messages.Should().ContainMatch("*return arguments[0].textContent;");
            Logger.Messages.Should().ContainMatch("*JavaScript code arguments:");
            Logger.Messages.Should().ContainMatch("*IWebElement*");
        }
コード例 #2
0
        public void TestScriptWithLocatorDoesNotExist()
        {
            SetUpFindElementsReturnsEmpty();

            Actor.Invoking(x => x.Calls(JavaScriptText.Of(Locator))).Should().Throw <WaitingException <bool> >();
        }