コード例 #1
0
ファイル: ITManageTest.java プロジェクト: dmetzler/nuxeo
  /**
   * Test trash management.
   *
   * @since 7.1
   */
  @Test
  public void testTrashPurge() throws UserNotConnectedException, IOException {
    DocumentBasePage documentBasePage = login();

    // Create a file under workspace.
    DocumentBasePage workspacePage = documentBasePage.createWorkspace(WORKSPACE_TITLE, null);
    DocumentBasePage filePage =
        workspacePage.createFile(TEST_FILE_TITLE, null, false, null, null, null);

    // Copy/paste it to get 5 files.
    ContentTabSubPage content =
        filePage
            .getHeaderLinks()
            .getNavigationSubPage()
            .goToDocument(WORKSPACE_TITLE)
            .getContentTab()
            .copyByTitle(TEST_FILE_TITLE)
            .paste()
            .paste()
            .paste()
            .paste();

    List<WebElement> docs = content.getChildDocumentRows();
    assertNotNull(docs);
    assertEquals(5, docs.size());
    // Select all files and remove them.
    docs = content.removeAllDocuments().getChildDocumentRows();
    assertNotNull(docs);
    assertEquals(0, docs.size());

    // Go to trash page.
    TrashSubPage trashSubPage = asPage(DocumentBasePage.class).getManageTab().getTrashSubTab();
    docs = trashSubPage.getChildDocumentRows();
    assertNotNull(docs);
    assertEquals(5, docs.size());

    // Empty the trash.
    docs = trashSubPage.emptyTrash().getChildDocumentRows();
    assertNotNull(docs);
    assertEquals(0, docs.size());

    // cleanup workspace
    asPage(DocumentBasePage.class).getNavigationSubPage().goToDocument("Workspaces");
    asPage(ContentTabSubPage.class).removeDocument(WORKSPACE_TITLE);
  }
コード例 #2
0
ファイル: ITCopyPasteTest.java プロジェクト: mindis/nuxeo
  /**
   * Copy and paste a simple file.
   *
   * @since 5.8
   */
  @Test
  public void testSimpleCopyAndPaste()
      throws UserNotConnectedException, IOException, ParseException {
    // NXP-18344, to be removed once upgraded to more recent webdriver lib
    doNotRunOnWindowsWithFF26();

    prepare();

    DocumentBasePage documentBasePage;

    // Log as test user and edit the created workspace
    documentBasePage =
        loginAsTestUser()
            .getContentTab()
            .goToDocument("Workspaces")
            .getContentTab()
            .goToDocument(WORKSPACE1_TITLE);

    ContentTabSubPage contentTabSubPage = documentBasePage.getContentTab();

    contentTabSubPage.copyByTitle(FILE1_NAME);

    documentBasePage =
        contentTabSubPage.getHeaderLinks().getNavigationSubPage().goToDocument(WORKSPACE2_TITLE);

    contentTabSubPage = documentBasePage.getContentTab();

    contentTabSubPage = contentTabSubPage.paste();

    List<WebElement> docs = contentTabSubPage.getChildDocumentRows();

    assertNotNull(docs);
    assertEquals(docs.size(), 1);
    assertNotNull(docs.get(0).findElement(By.linkText(FILE1_NAME)));

    restoreSate();
  }