Search in sources :

Example 16 with LiveTableElement

use of org.xwiki.test.ui.po.LiveTableElement in project xwiki-platform by xwiki.

the class AllDocsPage method clickIndexTab.

public LiveTableElement clickIndexTab() {
    this.indexTab.click();
    LiveTableElement lt = new LiveTableElement("alldocs");
    lt.waitUntilReady();
    return lt;
}
Also used : LiveTableElement(org.xwiki.test.ui.po.LiveTableElement)

Example 17 with LiveTableElement

use of org.xwiki.test.ui.po.LiveTableElement in project xwiki-platform by xwiki.

the class AllDocsPage method clickDeletedDocsTab.

public LiveTableElement clickDeletedDocsTab() {
    this.deletedDocsTab.click();
    LiveTableElement lt = new LiveTableElement("documentsTrash");
    lt.waitUntilReady();
    return lt;
}
Also used : LiveTableElement(org.xwiki.test.ui.po.LiveTableElement)

Example 18 with LiveTableElement

use of org.xwiki.test.ui.po.LiveTableElement in project xwiki-platform by xwiki.

the class DocumentsMacroTest method testDocumentsMacro.

/**
 * Verify that the {{documents}} macro works by going to the page defining this wiki macro since it contains
 * an example usage and we can verify it displays the expected result.
 */
@Test
public void testDocumentsMacro() throws Exception {
    // Create a dummy page in the Main space and having Main.WebHome as its parent so that it appears in the
    // Documents Macro livetable (since the example lists pages in the Main space having Main.WebHome as their
    // parent).
    getUtil().createPage("Main", getTestMethodName(), "", "Test Title", "xwiki/2.1", "Main.WebHome");
    DocumentsMacroPage dmp = DocumentsMacroPage.gotoPage();
    LiveTableElement livetable = dmp.getDocumentsExampleLiveTable();
    // Verify that we have a Page column
    Assert.assertTrue("No Title column found", livetable.hasColumn("Title"));
    // Verify there are several rows displayed
    Assert.assertTrue(livetable.getRowCount() > 0);
    // Verify that page titles are displayed by filtering on one page for which we know the title
    livetable.filterColumn("xwiki-livetable-example-filter-2", getTestMethodName());
    Assert.assertTrue(livetable.hasRow("Title", "Test Title"));
}
Also used : LiveTableElement(org.xwiki.test.ui.po.LiveTableElement) DocumentsMacroPage(org.xwiki.index.test.po.DocumentsMacroPage) Test(org.junit.Test) AbstractGuestTest(org.xwiki.test.ui.AbstractGuestTest)

Example 19 with LiveTableElement

use of org.xwiki.test.ui.po.LiveTableElement in project xwiki-platform by xwiki.

the class UserDirectoryPage method getUserDirectoryLiveTable.

public LiveTableElement getUserDirectoryLiveTable() {
    LiveTableElement lt = new LiveTableElement("userdirectory");
    lt.waitUntilReady();
    return lt;
}
Also used : LiveTableElement(org.xwiki.test.ui.po.LiveTableElement)

Example 20 with LiveTableElement

use of org.xwiki.test.ui.po.LiveTableElement in project xwiki-platform by xwiki.

the class UserDirectoryTest method verifyUserIsListed.

@Test
public void verifyUserIsListed() {
    // Delete possible existing user
    getUtil().deletePage("XWiki", "test");
    UserDirectoryPage page = UserDirectoryPage.gotoPage();
    // Verify that the user directory is empty when there's no user in the wiki
    LiveTableElement liveTableElement = page.getUserDirectoryLiveTable();
    assertEquals(0, liveTableElement.getRowCount());
    // Add a user and verify it's visible in the livetable
    getUtil().createUserAndLogin("test", "testtest", "first_name", "John", "last_name", "Doe");
    // Go back to the user directory page since the user creation navigated to another page
    page = UserDirectoryPage.gotoPage();
    assertEquals(1, liveTableElement.getRowCount());
    assertTrue(liveTableElement.hasRow("User ID", "test"));
    assertTrue(liveTableElement.hasRow("First Name", "John"));
    assertTrue(liveTableElement.hasRow("Last Name", "Doe"));
    // Log out to verify the livetable works in guest view too
    getUtil().forceGuestUser();
    assertEquals(1, liveTableElement.getRowCount());
    assertTrue(liveTableElement.hasRow("User ID", "test"));
    assertTrue(liveTableElement.hasRow("First Name", "John"));
    assertTrue(liveTableElement.hasRow("Last Name", "Doe"));
}
Also used : LiveTableElement(org.xwiki.test.ui.po.LiveTableElement) UserDirectoryPage(org.xwiki.user.directory.test.po.UserDirectoryPage) 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