コード例 #1
0
 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\"]");
     }
 }
コード例 #2
0
 public void ShouldGoToPageEnterTextClickButtonAndWaitForElementsToAppear()
 {
     using (var I = new FluentDriver(new FirefoxDriver(null, new FirefoxProfile { EnableNativeEvents = false })))
     {
         I.OpenPage(google);
         I.EnterText("cats").Into("input[name=\"q\"]");
         Action act = () => I.Expect().ValueOf("input[name=\"q\"]").ToBe("cats");
         act.ShouldNotThrow<Exception>();
     }
 }
コード例 #3
0
 public void ShouldNotWaitForElementsToAppearAndThrow()
 {
     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").ToBe("cats"); };
         act.ShouldThrow<Exception>();
     }
 }
コード例 #4
0
        public void CanVerifyValueOfTextbox()
        {
            using (var I = new FluentDriver(new FirefoxDriver(null, new FirefoxProfile { EnableNativeEvents = false })))
            {
                I.OpenPage(google);
                I.EnterText("cats").Into("input[name=\"q\"]");

                Action toBeAction = () => I.Expect().ValueOf("input[name=\"q\"]").ToBe("cats");
                toBeAction.ShouldNotThrow<Exception>();

                Action notToBeAction = () => I.Expect().ValueOf("input[name=\"q\"]").NotToBe("dogs");
                notToBeAction.ShouldNotThrow<Exception>();
            }
        }
コード例 #5
0
        public void ShouldGoToPage()
        {
            var driver = new Mock<IWebDriver>();
            var navigation = new Mock<INavigation>();

            driver.Setup(d => d.Navigate()).Returns(navigation.Object);
            navigation.Setup(n => n.GoToUrl(It.IsAny<string>())).Verifiable();

            using (var I = new FluentDriver(driver.Object))
            {
                I.OpenPage("http://www.google.com");
            }

            navigation.Verify();
        }