@Test public void shouldNotFindUnexistingCookie() { final WebDriver driver = mock(WebDriver.class); Options options = mock(Options.class); when(driver.manage()).thenReturn(options); when(options.getCookieNamed(eq(cookieName))).thenReturn(null); assertThat("Cook should not be found", driver, not(hasCookie(cookieName))); }
@Factory public static Matcher<WebDriver> hasCookie(String name) { return new HasCookieMatcher(name); }
HasCookieMatcher extends TypeSafeMatcher<WebDriver> { @Factory public static Matcher<WebDriver> hasCookie(String name) { return new HasCookieMatcher(name); } }
HasCookieMatcher extends TypeSafeMatcher<WebDriver> { @Factory public static Matcher<WebDriver> hasCookie(String name) { return new HasCookieMatcher(name); } protected  HasCookieMatcher(String name); }
HasCookieMatcher extends TypeSafeMatcher<WebDriver> { @Factory public static Matcher<WebDriver> hasCookie(String name) { return new HasCookieMatcher(name); } protected  HasCookieMatcher(String name); @Override void describeTo(Description description); @Factory static Matcher<WebDriver> hasCookie(String name); }
HasCookieMatcher extends TypeSafeMatcher<WebDriver> { @Factory public static Matcher<WebDriver> hasCookie(String name) { return new HasCookieMatcher(name); } protected  HasCookieMatcher(String name); @Override void describeTo(Description description); @Factory static Matcher<WebDriver> hasCookie(String name);  }