/** Qmetry: ID 66793 -- Case No 040 / ID 007 -- Cut a Category and paste into itself -- */
  @Test
  public void test07_CutACategoryAndPasteIntoItself() {
    info("-- Step 1: Create a Category --");

    String categoryTreeName = "categoryAction07";

    nav.goToContentAdministration();

    // Add category tree
    String[] form1 = {categoryTreeName, categoryWorkspace, nodeHomePath};
    String[] form2 = {groupID, "*"};
    String[] form3 = {actionName, optionLifeCycle, nodeTargetPath};
    boolean[] setPermission = {true, false, false};
    magCa.addNewCategoryTree(form1, false, true, form2, DATA_USER1, setPermission, form3);
    waitForTextPresent(categoryTreeName);

    info("-- Step 2: Cut a Category --");
    magCa.addChildCategory(categoryTreeName, categoryName);
    click(magCa.ELEMENT_CUT_CATEGORY_ICON.replace("${categoryName}", categoryName));

    info("-- Step 3: Paste cut Category into itself --");
    click(magCa.ELEMENT_PASTE_TO_CATEGORY_ICON.replace("${categoryName}", categoryName));
    alert.verifyAlertMessage(
        magCa.MESSAGE_INFO_CUT_TO_CATEGORY.replace(
            "${pathCategory}", "/sites/intranet/" + categoryTreeName + "/" + categoryName + ""));

    info("-- Restore original data --");
    button.close();
    magCa.deleteCategory(categoryTreeName);

    info("-- Sign Out --");
    // signOut();
  }
  /** Qmetry: ID 66792 -- Case No 039 / ID 006 -- Cut a Category and paste into its child node -- */
  @Test
  public void test06_CutACategoryAndPasteIntoItsChildNode() {
    By ELEMENT_SELECTED_CATEGORY_NAME =
        By.xpath(cMenu.ELEMENT_FILE_TITLE.replace("${titleOfFile}", categoryName));

    info("-- Step 1: Create a Category --");

    String categoryTreeName = "categoryAction06";

    nav.goToContentAdministration();

    // Add category tree
    String[] form1 = {categoryTreeName, categoryWorkspace, nodeHomePath};
    String[] form2 = {groupID, "*"};
    String[] form3 = {actionName, optionLifeCycle, nodeTargetPath};
    boolean[] setPermission = {true, false, false};
    magCa.addNewCategoryTree(form1, false, true, form2, DATA_USER1, setPermission, form3);
    waitForTextPresent(categoryTreeName);

    info("-- Step 2: Cut a Category --");
    magCa.addChildCategory(categoryTreeName, categoryName);
    magCa.addChildCategory(categoryName, newCategoryName, true);
    ecms.clickUpLevel();
    click(magCa.ELEMENT_CUT_CATEGORY_ICON.replace("${categoryName}", categoryName));

    info("-- Step 3: Paste a cut Category into its child node --");
    click(ELEMENT_SELECTED_CATEGORY_NAME);
    click(magCa.ELEMENT_PASTE_TO_CATEGORY_ICON.replace("${categoryName}", newCategoryName));
    waitForMessage(magCa.MESSAGE_INFO_PASTE_TO_CATEGORY);
    // dialog.closeMessageDialog();
    click(button.ELEMENT_OK_BUTTON);

    info("-- Restore original data --");
    button.close();
    magCa.deleteCategory(categoryTreeName);

    info("-- Sign Out --");
    // signOut();
  }
  /** Qmetry: ID 66827 -- Case No 041 / ID 008 -- Cut/Paste a deleted Category -- */
  @Test
  public void test08_CutPasteADeletedCategory() {
    info("-- Step 1: Create a Category --");
    String categoryTreeName = "categoryAction08";

    nav.goToContentAdministration();

    // Add category tree
    String[] form1 = {categoryTreeName, categoryWorkspace, nodeHomePath};
    String[] form2 = {groupID, "*"};
    String[] form3 = {actionName, optionLifeCycle, nodeTargetPath};
    boolean[] setPermission = {true, false, false};
    magCa.addNewCategoryTree(form1, false, true, form2, DATA_USER1, setPermission, form3);
    waitForTextPresent(categoryTreeName);

    info("-- Step 2: Cut a Category --");
    magCa.addChildCategory(categoryTreeName, categoryName);
    ecms.clickUpLevel();
    magCa.addChildCategory(categoryTreeName, newCategoryName);
    click(magCa.ELEMENT_CUT_CATEGORY_ICON.replace("${categoryName}", newCategoryName));

    info("-- Step 3: Delete Category --");
    magCa.deleteCategory(newCategoryName);

    info("-- Step 4: Paste deleted Category --");
    click(magCa.ELEMENT_PASTE_TO_CATEGORY_ICON.replace("${categoryName}", categoryName));
    waitForMessage(magCa.MESSAGE_INFO_PASTE_TO_CATEGORY);
    // dialog.closeMessageDialog();
    click(button.ELEMENT_OK_BUTTON);

    info("-- Restore original data --");
    button.close();
    magCa.deleteCategory(categoryTreeName);

    info("-- Sign Out --");
    // signOut();
  }