@Test
public void withCookiesAndStandardOutcome() throws Exception
{
// GIVEN a browser with cookies enabled
WebDriver driver = createBrowserAndLoadPage(true);
assertThat(driver.getPageSource(), Matchers.not(Matchers.containsString("jsessionid")));
// WHEN a JSF action redirects with a standard outcome
driver.findElement(By.id("form:standardOutcome")).click();
// THEN the browser should be redirected
assertThat(driver.getCurrentUrl(), Matchers.containsString("redirected=true"));
// AND there should be no jsessionid in the URL
assertThat(driver.getCurrentUrl(), Matchers.not(Matchers.containsString("jsessionid")));
}