Example #1
0
 @Test(groups = {"platform", "add new group"})
 public void testAddNewGroup() {
   System.out.println("--Create a new group--");
   magAcc.signIn(USER_ROOT, DATA_PASS);
   Utils.pause(1000);
   goToUsersAndGroupsManagement();
   Utils.pause(1000);
   userGroup.chooseGroupTab();
   Utils.pause(1000);
   userGroup.addGroup(groupName, groupLabel, groupDesc, verify);
   magAcc.signOut();
   Utils.pause(1000);
 }
Example #2
0
 @Test(groups = {"platform", "add new group"})
 public void testDeleteGroup() {
   System.out.println("--Delete a new group--");
   magAcc.signIn(USER_ROOT, DATA_PASS);
   Utils.pause(1000);
   goToUsersAndGroupsManagement();
   Utils.pause(1000);
   userGroup.chooseGroupTab();
   Utils.pause(1000);
   userGroup.selectGroup(groupName);
   userGroup.deleteGroup(groupName, true);
   Utils.pause(3000);
   magAcc.signOut();
   Utils.pause(1000);
 }
Example #3
0
 @Test(groups = {"platform", "add new group"})
 public void testAddUserIntoGroup() {
   System.out.println("--Add user to a group--");
   magAcc.signIn(USER_ROOT, DATA_PASS);
   Utils.pause(1000);
   goToUsersAndGroupsManagement();
   Utils.pause(1000);
   userGroup.chooseGroupTab();
   Utils.pause(1000);
   userGroup.selectGroup(groupName);
   userGroup.addUsersToGroup(userName, memberShip, select, verify);
   Utils.pause(1000);
   magAcc.signOut();
   Utils.pause(1000);
 }
Example #4
0
 @Test(groups = {"platform", "add new group"})
 public void testSelectAndEditGroup() {
   System.out.println("--Edit a new group--");
   magAcc.signIn(USER_ROOT, DATA_PASS);
   Utils.pause(1000);
   goToUsersAndGroupsManagement();
   Utils.pause(1000);
   userGroup.chooseGroupTab();
   Utils.pause(1000);
   userGroup.selectGroup(groupName);
   // userGroup.editGroup(groupName, true);
   type(ELEMENT_INPUT_LABEL, "", true);
   type(ELEMENT_TEXTAREA_DESCRIPTION, "edit a group description", true);
   button.save();
   Utils.pause(1000);
   magAcc.signOut();
   Utils.pause(1000);
 }
  /** Qmetry ID: 67841 Manage Lock ================ */
  @Test
  public void test02_ManageLock() {
    String fileTitle = "Ecms_Admin_Manage_Lock";
    String content = "All users in the selected group, would be able to unlock";
    By eLockedFile = By.xpath(cMenu.ELEMENT_FILE_TITLE.replace("${titleOfFile}", fileTitle));
    String elementLockedArticleIcon =
        cMenu.ELEMENT_FILE_LOCKED_BY_ADMIN.replace("${titleOfFile}", fileTitle);

    By ELEMENT_GROUP_MEMBERSHIP = By.linkText("manager");
    String ELEMENT_GROUP_MEMBERSHIP_DISPLAY = "manager";
    String ELEMENT_GROUP_TO_SELECT = "Platform/Content Management";
    String ELEMENT_GROUP_DISPLAY = "platform/web-contributors";

    info("-- Test case: Manage lock --");

    // Go to Site Explorer
    nav.goToSiteExplorer();
    // actBar.goToSitesManagement();
    ecms.goToNode("intranet/documents");

    // Create a new File
    actBar.goToAddNewContent();
    cTemplate.createNewFile(fileTitle, content, fileTitle);

    // Lock this File
    cMenu.contextMenuAction(eLockedFile, cMenu.ELEMENT_CONTEXT_MENU_LOCK);
    click(cMenu.ELEMENT_DOCUMENT);
    waitForAndGetElement(elementLockedArticleIcon);

    // Open form to add permission for Users/Group (unlock node)
    // Add permission for group to unlock node
    ecMain.goToManageLockTab();
    userGroup.selectGroup(ELEMENT_GROUP_TO_SELECT, true);
    click(ELEMENT_GROUP_MEMBERSHIP);

    // Groups are listed on the table
    waitForTextPresent(ELEMENT_GROUP_MEMBERSHIP_DISPLAY + ":/" + ELEMENT_GROUP_DISPLAY);

    // Login with user in the selected group and un lock that node
    driver.close();
    driver = new FirefoxDriver();
    driver.get(baseUrl);
    nav = new NavigationToolbar(driver);
    magAcc = new ManageAccount(driver);
    ecMain = new ECMainFunction(driver);
    adminPer = new Permission(driver);
    cMenu = new ContextMenu(driver);
    ecms = new EcmsBase(driver);

    magAcc.signIn("mary", "gtn");
    ecMain.goToLockedTab();
    click(ecMain.ELEMENT_UNLOCK_NODE.replace("${lockedNode}", fileTitle));
    waitForTextNotPresent(fileTitle);

    // Admin re-LogIn and Delete Permission...
    magAcc.signOut();
    magAcc.signIn(DATA_USER, DATA_PASS);
    ecMain.goToManageLockTab();
    click(
        adminPer.ELEMENT_DELETE_SELECTED_GROUP.replace("${selectedGroup}", ELEMENT_GROUP_DISPLAY));
    waitForTextNotPresent(ELEMENT_GROUP_MEMBERSHIP_DISPLAY + ":/" + ELEMENT_GROUP_DISPLAY);

    // Restore data
    nav.goToSiteExplorer();
    ecms.goToNode("intranet/documents");
    cMenu.deleteDocument(eLockedFile);
  }
 /**
  * Add target group for a space when create new space
  *
  * @param groupPath
  * @param childGroupName
  */
 public void addUserGroupToInvite(String groupPath, String childGroupName) {
   click(ELEMENT_USER_GROUP_CHECKBOX);
   userGroup.selectGroup(groupPath);
   click(By.linkText(childGroupName));
 }
  /**
   * Delete node with deleting confirmation CaseID 73406 Step 1: Show Edit Navigation form Step 2:
   * Delete node Step 3: Check page of deleted node
   */
  @Test
  public void test01_DeleteNodeWithDeletingConfirmation() {
    /*Declare variables*/
    String groupNameDisplayName = "aagroup73406";
    String nodeName = "nodeTest73406";
    String pageSelectorName = "page73406";
    String nodeLinkToEdit = ELEMENT_NODE_LINK.replace("${nodeLabel}", nodeName);
    Map<String, String> languages = new HashMap<String, String>();
    languages.put("English", "");

    /*Create data*/
    info("Create new group with John");
    navTool.goToUsersAndGroupsManagement();
    group.chooseGroupTab();
    group.addGroup(groupNameDisplayName, null, null, true);

    info("Add new navigation for new group");
    navTool.goToGroupSites();
    addNewNavigationForGroup(groupNameDisplayName);

    info("Add a new node for group");
    addNodeForGroup(
        groupNameDisplayName,
        "",
        true,
        nodeName,
        true,
        languages,
        nodeName,
        pageSelectorName,
        pageSelectorName,
        true,
        true);

    /* Step 1: Show Edit Navigation form */
    // - Login by admin or user is manager of at least the exited group navigation
    // - Click Group link and choose a group navigation
    // -  Click Edit navigation link
    // Show Navigation management form
    editNavigation(groupNameDisplayName);

    /* Step 2: Delete node */
    // - chose a node
    // - Right click on node & select Delete node
    // - Click OK to confirm
    // Node is removed
    rightClickOnElement(nodeLinkToEdit);
    click(ELEMENT_NAVIGATION_DELETE_NODE);
    magAlert.acceptAlert();
    waitForElementNotPresent(nodeLinkToEdit);
    button.save();
    waitForElementNotPresent(button.ELEMENT_SAVE_BUTTON);

    /* Step 3: Check page of deleted node */
    // Go to Page Management, check existing of page that deleted node linked to
    // Page still exists
    navToolbar.goToManagePages();
    pageMag.searchPageInManagementPage(PageType.GROUP, pageSelectorName, true);
    waitForAndGetElement(
        pageMag
            .ELEMENT_LIST_PAGE
            .replace("${number}", "1")
            .replace("${titlePage}", pageSelectorName));

    /*Clear data*/
    info("-- Clear data --");
    pageMag.deletePage(PageType.GROUP, pageSelectorName);
    navTool.goToGroupSites();
    deleteNavigationForGroup(groupNameDisplayName);
    navTool.goToUsersAndGroupsManagement();
    group.chooseGroupTab();
    click(By.linkText(groupNameDisplayName));
    group.deleteGroup(groupNameDisplayName, true, 60000);
  }
  /**
   * Delete node with deleting confirmation CaseID 73485 Step 1: Show Edit group's navigation Step
   * 2: Show form to add new node Step 3: Create node
   */
  @Test
  public void test02_CreateNewNodeAsChildOfExistingNode() {
    /*Declare variables*/
    String groupNameDisplayName = "aagroup73485";
    String nodeName = "nodeTest73485";
    String subNodeName = "subNode73485";
    String pageSelectorName = "page73485";
    String subPageSelectorName = "subpage73485";
    Map<String, String> languages = new HashMap<String, String>();
    languages.put("English", "");

    /*Create data*/
    info("Create new group with John");
    navTool.goToUsersAndGroupsManagement();
    group.chooseGroupTab();
    group.addGroup(groupNameDisplayName, null, null, true);

    info("Add new navigation for new group");
    navTool.goToGroupSites();
    addNewNavigationForGroup(groupNameDisplayName);

    info("Add a new node for group");
    addNodeForGroup(
        groupNameDisplayName,
        "",
        true,
        nodeName,
        true,
        languages,
        nodeName,
        pageSelectorName,
        pageSelectorName,
        true,
        true);

    /* Step 1: Show Edit group's navigation */
    // - Login by user is manager of at least the exited group navigation
    // - Click on Group link
    // - Select a Group navigation and click on [Edit navigation] link
    // Edit Group navigation is show with all exited node on group's nav
    editNavigation(groupNameDisplayName);

    /* Step 2: Show form to add new node */
    // - Choose a parent node
    // - Right click on one node & select Add new node
    // Add new node form is shown properly
    /* Step 3: Create node */
    // - Input values for required field
    // - Click Save
    // New node is created successfully & displayed as sub node of selected parent
    info("Add a sub new node for group");
    addNodeForGroup(
        groupNameDisplayName,
        nodeName,
        true,
        subNodeName,
        true,
        languages,
        subNodeName,
        subPageSelectorName,
        subPageSelectorName,
        true,
        true);

    /*Clear data*/
    info("-- Clear data --");
    navToolbar.goToManagePages();
    pageMag.deletePage(PageType.GROUP, subPageSelectorName);
    pageMag.deletePage(PageType.GROUP, pageSelectorName);
    navTool.goToGroupSites();
    deleteNavigationForGroup(groupNameDisplayName);
    navTool.goToUsersAndGroupsManagement();
    group.chooseGroupTab();
    click(By.linkText(groupNameDisplayName));
    group.deleteGroup(groupNameDisplayName, true, 60000);
  }