Search in sources :

Example 26 with LiveTableElement

use of org.xwiki.test.ui.po.LiveTableElement 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;
            }
        }
    });
}
Also used : WebDriver(org.openqa.selenium.WebDriver) LinkCheckerAllDocsPage(org.xwiki.linkchecker.test.po.LinkCheckerAllDocsPage) LiveTableElement(org.xwiki.test.ui.po.LiveTableElement) AbstractTest(org.xwiki.test.ui.AbstractTest) Test(org.junit.Test)

Aggregations

LiveTableElement (org.xwiki.test.ui.po.LiveTableElement)26 Test (org.junit.Test)16 AbstractTest (org.xwiki.test.ui.AbstractTest)15 ApplicationHomePage (org.xwiki.appwithinminutes.test.po.ApplicationHomePage)8 IgnoreBrowsers (org.xwiki.test.ui.browser.IgnoreBrowsers)6 ApplicationHomeEditPage (org.xwiki.appwithinminutes.test.po.ApplicationHomeEditPage)5 EntryEditPage (org.xwiki.appwithinminutes.test.po.EntryEditPage)5 EntryNamePane (org.xwiki.appwithinminutes.test.po.EntryNamePane)5 ViewPage (org.xwiki.test.ui.po.ViewPage)4 ByteArrayInputStream (java.io.ByteArrayInputStream)2 WebElement (org.openqa.selenium.WebElement)2 ApplicationClassEditPage (org.xwiki.appwithinminutes.test.po.ApplicationClassEditPage)2 ClassFieldEditPane (org.xwiki.appwithinminutes.test.po.ClassFieldEditPane)2 AllDocsPage (org.xwiki.index.test.po.AllDocsPage)2 WikiEditPage (org.xwiki.test.ui.po.editor.WikiEditPage)2 ServerSetupTest (com.icegreen.greenmail.util.ServerSetupTest)1 UsernamePasswordCredentials (org.apache.commons.httpclient.UsernamePasswordCredentials)1 WebDriver (org.openqa.selenium.WebDriver)1 AdministrationPage (org.xwiki.administration.test.po.AdministrationPage)1 AppWithinMinutesHomePage (org.xwiki.appwithinminutes.test.po.AppWithinMinutesHomePage)1