Created
July 11, 2011 13:35
-
-
Save illicitonion/1075850 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void testShouldBeAbleToIncludeLeadingPeriodInDomainName() throws Exception { | |
String name = gotoValidDomainAndClearCookies(); | |
if (name == null || name.matches("\\d{1,3}(?:\\.\\d{1,3}){3}")) { | |
System.out.println("Skipping test: unable to find domain name to use"); | |
return; | |
} | |
driver.manage().deleteAllCookies(); | |
assertNull("Looks like delete all cookies doesn't", driver.manage().getCookieNamed("name")); | |
// Replace the first part of the name with a period | |
String shorter = name.replaceFirst(".*?\\.", ""); | |
Cookie cookie = | |
new Cookie("name", "value", shorter, "/", new Date(System.currentTimeMillis() + 100000)); | |
driver.manage().addCookie(cookie); | |
assertNotNull(driver.manage().getCookieNamed("name")); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment