コード例 #1
0
 public void First()
 {
     RunInAllBrowsers(browser =>
     {
         browser.NavigateToUrl("TemporarySelector.aspx");
         browser.SelectMethod = s => SelectBy.CssSelector(s, "[data-ui='{0}']");
         AssertUI.CheckIfTextEquals(browser.First("p", By.TagName), "p");
         AssertUI.CheckIfTextEquals(browser.First("id", By.Id), "id");
         AssertUI.CheckIfTextEquals(browser.First("id"), "data");
     });
 }
コード例 #2
0
        public void CookieTest()
        {
            Action <BrowserWrapper> test = browser =>
            {
                browser.NavigateToUrl("CookiesTest.aspx");
                AssertUI.CheckIfTextEquals(browser.First("#CookieIndicator"), "False");
                browser.Click("#SetCookies").Wait();
                browser.NavigateToUrl("CookiesTest.aspx");
                AssertUI.CheckIfTextEquals(browser.First("#CookieIndicator"), "True");
            };

            RunInAllBrowsers(test);
            RunInAllBrowsers(test);
        }
コード例 #3
0
        public void TextTest()
        {
            RunInAllBrowsers(browser =>
            {
                browser.NavigateToUrl("text.aspx");

                AssertUI.CheckIfTextEquals(browser.First("#button"), "text", false);
                AssertUI.CheckIfTextEquals(browser.First("#input"), "text", false);
                AssertUI.CheckIfTextEquals(browser.First("#area"), "text", false);
                AssertUI.CheckIfText(browser.First("#button"), s => s.ToLower().Contains("text"));
                AssertUI.CheckIfText(browser.First("#input"), s => s.Contains("text"));
                AssertUI.CheckIfText(browser.First("#area"), s => s.Contains("text"));
            });
        }
コード例 #4
0
 public void TextNotEquals()
 {
     RunInAllBrowsers(browser =>
     {
         browser.NavigateToUrl("CookiesTest.aspx");
         var label = browser.First("#CookieIndicator");
         AssertUI.CheckIfTextEquals(label, "False");
         AssertUI.CheckIfTextNotEquals(label, "True");
         try
         {
             AssertUI.CheckIfTextNotEquals(label, "False");
             throw new Exception("Exception was expected.");
         }
         catch (UnexpectedElementStateException)
         {
         }
     });
 }