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"); }); }
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); }
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")); }); }
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) { } }); }