use of org.xwiki.linkchecker.test.po.LinkCheckerAllDocsPage in project xwiki-platform by xwiki.
the class LinkCheckerTest method testLinkChecker.
@Test
public void testLinkChecker() {
getUtil().deletePage(getClass().getSimpleName(), getTestMethodName());
// Create a page with a URL so that it appears in the Link Checker livetable.
getUtil().createPage(getClass().getSimpleName(), getTestMethodName(), "http://doesntexist", getTestClassName());
// Navigate to the Index page and click on the "External Links" tab
final LinkCheckerAllDocsPage page = LinkCheckerAllDocsPage.gotoPage();
// Since the LinkChecker works asynchronously there's small possibility that the link hasn't been added
// before the livetable displays, thus we wait till we get the link state.
getDriver().waitUntilCondition(new ExpectedCondition<Boolean>() {
public Boolean apply(WebDriver driver) {
LiveTableElement livetable = page.clickLinkCheckerTab();
if (livetable.hasRow("Link", "http://doesntexist")) {
return true;
} else {
return false;
}
}
});
}
Aggregations