@Test public void worksPositive() { WebDriver driver = mock(WebDriver.class); WebElement element = mock(WebElement.class); when(driver.findElement(XPATH_EXISTS)).thenReturn(element); assertThat("Element should be found", driver, canFindElement(XPATH_EXISTS)); }
@Factory public static Matcher<WebDriver> canFindElement(By by) { return new CanFindElementMatcher(by); }
CanFindElementMatcher extends TypeSafeMatcher<WebDriver> { @Factory public static Matcher<WebDriver> canFindElement(By by) { return new CanFindElementMatcher(by); } }
CanFindElementMatcher extends TypeSafeMatcher<WebDriver> { @Factory public static Matcher<WebDriver> canFindElement(By by) { return new CanFindElementMatcher(by); } protected  CanFindElementMatcher(By by); }
CanFindElementMatcher extends TypeSafeMatcher<WebDriver> { @Factory public static Matcher<WebDriver> canFindElement(By by) { return new CanFindElementMatcher(by); } protected  CanFindElementMatcher(By by); @Override void describeTo(Description description); @Factory static Matcher<WebDriver> canFindElement(By by); }
CanFindElementMatcher extends TypeSafeMatcher<WebDriver> { @Factory public static Matcher<WebDriver> canFindElement(By by) { return new CanFindElementMatcher(by); } protected  CanFindElementMatcher(By by); @Override void describeTo(Description description); @Factory static Matcher<WebDriver> canFindElement(By by);  }