Skip to content

Instantly share code, notes, and snippets.

@stirno
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stirno/9080874 to your computer and use it in GitHub Desktop.
Save stirno/9080874 to your computer and use it in GitHub Desktop.
Expect cookie exists with value
[TestClass]
public class AcceptanceTest1 : FluentAutomation.FluentTest<OpenQA.Selenium.IWebDriver>
{
public AcceptanceTest1()
{
FluentAutomation.SeleniumWebDriver.Bootstrap(FluentAutomation.SeleniumWebDriver.Browser.Chrome);
}
[TestMethod]
public void TestMethod1()
{
I.Expect.True(() => this.Provider.Manage().Cookies.GetCookieNamed("CrazyCookie").Value == "CookieValue");
}
}
@stirno
Copy link
Author

stirno commented Feb 18, 2014

Notice the use of the new (in 2.3) FluentTest type. This provides access to the underlying provider. Then you can use the .True/.False expects to work with the values.

@csharpforevermore
Copy link

This is absolute gold - but please can you either post links to these examples from your blog? I spent too long searching :-) Thanks for the hard work on this product though! It is fantastic being able to write fluent test cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment