public void ShouldGoToPageEnterTextAndClickButton() { using (var I = new FluentDriver(new FirefoxDriver(null, new FirefoxProfile { EnableNativeEvents = false }))) { I.OpenPage(google); I.EnterText("cats").Into("input[name=\"q\"]"); I.Click().On("input[name=\"btnK\"]"); } }
public void ShouldWaitForElementsToAppear() { using (var I = new FluentDriver(new FirefoxDriver(null, new FirefoxProfile { EnableNativeEvents = false }))) { I.OpenPage(google); I.EnterText("cats").Into("input[name=\"q\"]"); I.Click().On("input[name=\"btnK\"]"); Action act = () => I.Expect().ValueOf("#lst-ib").WithIn(2000).ToBe("cats"); act.ShouldNotThrow<Exception>(); } }
public void ShouldBeAbleToClickOnAnElement() { var driver = new Mock<IWebDriver>(); var webElement = new Mock<IWebElement>(); webElement.Setup(e => e.Click()).Verifiable(); driver.Setup(d => d.FindElement(It.IsAny<By>())).Returns(webElement.Object).Verifiable(); using (var I = new FluentDriver(driver.Object)) { I.Click().On("#search"); } driver.Verify(); webElement.Verify(); }