public void ShouldBeAbleToIncludeLeadingPeriodInDomainName()
{
driver.Url = simpleTestPage;
driver.Manage().DeleteAllCookies();
Regex nameRegex = new Regex("\\d{1,3}(?:\\.\\d{1,3}){3}");
string name = GotoValidDomainAndClearCookies();
if (name == null || nameRegex.IsMatch(name))
{
Assert.Ignore("Skipping test: Cookies can only be set on fully-qualified domain names.");
}
driver.Manage().DeleteAllCookies();
Assert.IsNull(driver.Manage().GetCookieNamed("name"), "Looks like delete all cookies doesn't");
// Replace the first part of the name with a period
Regex replaceRegex = new Regex(".*?\\.");
string shorter = replaceRegex.Replace(name, ".");
Cookie cookie = new Cookie("name", "value", shorter, "/", DateTime.Now.AddSeconds(100000));
driver.Manage().AddCookie(cookie);
Assert.IsNotNull(driver.Manage().GetCookieNamed("name"));
}