Skip to content

Commit

Permalink
Correcting .NET CookieImplementationTest for cookie-averse URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
jimevans committed Apr 11, 2019
1 parent 6d8ac2c commit fc84315
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions dotnet/test/common/CookieImplementationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -753,16 +753,17 @@ public void ShouldNotShowCookieAddedToDifferentPath()
}

[Test]
[IgnoreBrowser(Browser.Firefox, "Driver throws generic WebDriverException")]
public void ShouldThrowExceptionWhenAddingCookieToNonExistingDomain()
public void ShouldThrowExceptionWhenAddingCookieToCookieAverseDocument()
{
if (!CheckIsOnValidHostNameForCookieTests())
{
return;
}

driver.Url = macbethPage;
driver.Url = "http://nonexistent-origin.seleniumhq-test.test";
// URLs using a non-network scheme (like "about:" or "data:") are
// averse to cookies, and should throw an InvalidCookieDomainException.
driver.Url = "about:blank";

IOptions options = driver.Manage();
Cookie cookie = new Cookie("question", "dunno");
Assert.That(() => options.Cookies.AddCookie(cookie), Throws.InstanceOf<InvalidCookieDomainException>().Or.InstanceOf<InvalidOperationException>());
Expand Down

0 comments on commit fc84315

Please sign in to comment.