Represents a cookie returned to the driver by the browser.
Inheritance: Cookie
Beispiel #1
0
 public void CookiesShouldAllowSecureToBeSet()
 {
     Cookie cookie = new ReturnedCookie("name", "value", "", "/", DateTime.Now, true, false);
     Assert.IsTrue(cookie.Secure);
 }
Beispiel #2
0
 public void ShouldAllowExpiryToBeNull()
 {
     Cookie cookie = new ReturnedCookie("name", "value", "", "/", null, false, false);
 }
Beispiel #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);
        }
Beispiel #5
0
 public void ShouldThrowAnExceptionWhenUriOfReturnedCookieIsNull()
 {
     Cookie cookie = new ReturnedCookie("name", "value", "", "/", null, false, null);
 }
Beispiel #6
0
 public void ShouldAllowExpiryToBeNull()
 {
     Cookie cookie = new ReturnedCookie("name", "value", "", "/", null, false, new Uri("http://localhost"));
 }
Beispiel #7
0
 public void CookiesShouldAllowSecureToBeSet()
 {
     Cookie cookie = new ReturnedCookie("name", "value", "", "/", DateTime.Now, true, new Uri("http://localhost"));
     Assert.IsTrue(cookie.Secure);
 }