Represents a cookie returned to the driver by the browser.
Inheritance: Cookie
示例#1
0
 public void CookiesShouldAllowSecureToBeSet()
 {
     Cookie cookie = new ReturnedCookie("name", "value", "", "/", DateTime.Now, true, false);
     Assert.IsTrue(cookie.Secure);
 }
示例#2
0
 public void ShouldAllowExpiryToBeNull()
 {
     Cookie cookie = new ReturnedCookie("name", "value", "", "/", null, false, false);
 }
示例#3
0
 public void CookiesShouldAllowHttpOnlyToBeSet()
 {
     Cookie cookie = new ReturnedCookie("name", "value", "", "/", DateTime.Now, false, true);
     Assert.IsTrue(cookie.IsHttpOnly);
 }
        public void ShouldRetainCookieSecure()
        {
            driver.Url = EnvironmentManager.Instance.UrlBuilder.WhereIsSecure("animals");

            ReturnedCookie addedCookie = new ReturnedCookie("fish", "cod", string.Empty, "/common/animals", null, true, false);

            driver.Manage().Cookies.AddCookie(addedCookie);

            driver.Navigate().Refresh();

            Cookie retrieved = driver.Manage().Cookies.GetCookieNamed("fish");
            Assert.IsNotNull(retrieved);
            Assert.IsTrue(retrieved.Secure);
        }
示例#5
0
 public void ShouldThrowAnExceptionWhenUriOfReturnedCookieIsNull()
 {
     Cookie cookie = new ReturnedCookie("name", "value", "", "/", null, false, null);
 }
示例#6
0
 public void ShouldAllowExpiryToBeNull()
 {
     Cookie cookie = new ReturnedCookie("name", "value", "", "/", null, false, new Uri("http://localhost"));
 }
示例#7
0
 public void CookiesShouldAllowSecureToBeSet()
 {
     Cookie cookie = new ReturnedCookie("name", "value", "", "/", DateTime.Now, true, new Uri("http://localhost"));
     Assert.IsTrue(cookie.Secure);
 }