Exemple #1
0
  private void TagGroup(DialogTag dialogTag, ContactGroupItem group) throws HarnessException {

    String tagName = "tag" + ZimbraSeleniumProperties.getUniqueString();
    dialogTag.zSetTagName(tagName);
    dialogTag.zClickButton(Button.B_OK);

    // Make sure the tag was created on the server (get the tag ID)
    app.zGetActiveAccount().soapSend("<GetTagRequest xmlns='urn:zimbraMail'/>");
    ;
    String tagID =
        app.zGetActiveAccount()
            .soapSelectValue("//mail:GetTagResponse//mail:tag[@name='" + tagName + "']", "id");

    // Make sure the tag was applied to the contact
    app.zGetActiveAccount()
        .soapSend(
            "<GetContactsRequest xmlns='urn:zimbraMail'>"
                + "<cn id='"
                + group.getId()
                + "'/>"
                + "</GetContactsRequest>");

    String contactTags =
        app.zGetActiveAccount().soapSelectValue("//mail:GetContactsResponse//mail:cn", "t");

    ZAssert.assertEquals(
        contactTags, tagID, "Verify the tag appears on the contact id=" + group.getId());

    // verify toasted message '1 contact tagged ...'
    String expectedMsg = "1 contact group tagged \"" + tagName + "\"";
    ZAssert.assertStringContains(
        app.zPageMain.zGetToaster().zGetToastMessage(),
        expectedMsg,
        "Verify toast message '" + expectedMsg + "'");
  }
  @Test(
      description = "Delete a conversation",
      groups = {"smoke"})
  public void DeleteConversation_01() throws HarnessException {

    // Create the message data to be sent
    ConversationItem c = ConversationItem.createConversationItem(app.zGetActiveAccount());

    // Click Get Mail button
    app.zPageMail.zToolbarPressButton(Button.B_GETMAIL);

    // Select the item
    app.zPageMail.zListItem(Action.A_LEFTCLICK, c.getSubject());

    // Click delete
    app.zPageMail.zToolbarPressButton(Button.B_DELETE);

    List<MailItem> conversations = app.zPageMail.zListGetMessages();
    ZAssert.assertNotNull(conversations, "Verify the conversation list exists");

    boolean found = false;
    for (MailItem m : conversations) {
      logger.info("Subject: looking for " + c.getSubject() + " found: " + m.gSubject);
      if (c.getSubject().equals(m.getSubject())) {
        found = true;
        break;
      }
    }
    ZAssert.assertFalse(found, "Verify the conversation is no longer in the inbox");
  }
  @Test(
      description = "D1 Enhancement : Add a contact to an existing group",
      groups = {"smoke", "matt"})
  public void Add1ContactToExistingGroup() throws HarnessException {

    // -- Data

    // Create a contact
    ContactItem contact = ContactItem.createContactItem(app.zGetActiveAccount());

    // Create a contact group
    ContactGroupItem group = ContactGroupItem.createContactGroupItem(app.zGetActiveAccount());

    // -- GUI

    // Refresh
    app.zPageAddressbook.zRefresh();

    // Right click on the contact -> Group -> Existing Group Name
    app.zPageAddressbook.zListItem(
        Action.A_RIGHTCLICK, Button.B_CONTACTGROUP, group, contact.getName());

    // -- Verification

    // Verify the contact group is created
    ContactGroupItem actual =
        ContactGroupItem.importFromSOAP(app.zGetActiveAccount(), group.getName());
    ZAssert.assertNotNull(actual, "Verify the contact group is created");

    // Verify the contact group contains the contact
    ZAssert.assertContains(
        actual.getMemberList(),
        new ContactGroupItem.MemberItemContact(contact),
        "Verify the contact group conatins the contact");
  }
  @Bugs(ids = "82807")
  @Test(
      description = "Hover over an image attachment",
      dataProvider = "DataProviderMimeWithImageAttachments",
      groups = {"functional"})
  public void HoverOverAttachment_01(String subject, String path) throws HarnessException {

    // -- DATA

    final String mimeFile = ZimbraSeleniumProperties.getBaseDirectory() + path;
    LmtpInject.injectFile(app.zGetActiveAccount().EmailAddress, new File(mimeFile));

    // -- GUI

    // Click on Get Mail to refresh the folder list
    app.zPageMail.zToolbarPressButton(Button.B_GETMAIL);

    // Select the message
    DisplayMail display = (DisplayMail) app.zPageMail.zListItem(Action.A_LEFTCLICK, subject);

    List<AttachmentItem> attachments = display.zListGetAttachments();
    ZAssert.assertEquals(attachments.size(), 1, "Verify the attachment appears");

    TooltipImage tooltip =
        (TooltipImage) display.zListAttachmentItem(Action.A_HOVEROVER, attachments.get(0));

    // -- VERIFICATION

    ZAssert.assertTrue(tooltip.zIsActive(), "Verify the tooltip shows");
    ZAssert.assertNotNull(tooltip.zGetField(Field.URL), "Verify the image URL");
  }
  @Test(
      description = "Edit a folder, change the color (Context menu -> Edit)",
      groups = {"functional"})
  public void ChangeColorOfSystemFolders() throws HarnessException {

    // -- Data

    FolderItem contacts = FolderItem.importFromSOAP(app.zGetActiveAccount(), SystemFolder.Contacts);

    // -- GUI

    // Refresh
    app.zPageAddressbook.zRefresh();

    // Change the folder's color using context menu
    DialogEditFolder dialog =
        (DialogEditFolder)
            app.zTreeContacts.zTreeItem(Action.A_RIGHTCLICK, Button.B_TREE_EDIT, contacts);
    ZAssert.assertNotNull(dialog, "Verify the dialog opened");

    dialog.zSetNewColor(FolderColor.Green);
    dialog.zClickButton(Button.B_OK);

    // -- Verification

    // Get the folder again
    FolderItem actual = FolderItem.importFromSOAP(app.zGetActiveAccount(), contacts.getName());

    ZAssert.assertEquals(
        actual.getColor(), "3", "Verify the color of the folder is set to green (3)");
  }
Exemple #6
0
  @Test(
      description = "Create a new tasklist using tasks app New -> New Task Folder",
      groups = {"functional"})
  public void CreateTaskFolder_02() throws HarnessException {
    ZimbraAccount account = app.zGetActiveAccount();

    FolderItem taskFolder = FolderItem.importFromSOAP(account, SystemFolder.Tasks);

    _folderName = "taskfolder" + ZimbraSeleniumProperties.getUniqueString();

    // Create folder
    DialogCreateTaskFolder createTaskFolderDialog =
        (DialogCreateTaskFolder)
            app.zPageTasks.zToolbarPressPulldown(Button.B_NEW, Button.O_NEW_TASKFOLDER);

    createTaskFolderDialog.zEnterFolderName(_folderName);
    createTaskFolderDialog.zClickButton(Button.B_OK);

    _folderIsCreated = true;

    SleepUtil.sleepVerySmall();

    // refresh task page
    app.zTreeTasks.zTreeItem(Action.A_LEFTCLICK, taskFolder);

    // Make sure the task folder was created on the ZCS server
    FolderItem folder = FolderItem.importFromSOAP(app.zGetActiveAccount(), _folderName);
    ZAssert.assertNotNull(folder, "Verify task folder is created");
    ZAssert.assertEquals(
        folder.getName(), _folderName, "Verify the server and client folder names match");
  }
Exemple #7
0
  @Test(
      description = "Create a new tasklist by clicking 'Create a new task' on task folders tree",
      groups = {"sanity"})
  public void CreateTaskFolder_01() throws HarnessException {
    ZimbraAccount account = app.zGetActiveAccount();

    FolderItem taskFolder = FolderItem.importFromSOAP(account, SystemFolder.Tasks);

    _folderName = "taskfolder" + ZimbraSeleniumProperties.getUniqueString();

    // Create folder
    // DialogCreateTaskFolder createTaskFolderDialog
    // =(DialogCreateTaskFolder)app.zTreeTasks.zPressButton(Button.B_TREE_NEWTASKLIST);
    DialogCreateTaskFolder createTaskFolderDialog =
        (DialogCreateTaskFolder)
            app.zTreeTasks.zPressPulldown(Button.B_TREE_FOLDERS_OPTIONS, Button.B_TREE_NEWTASKLIST);

    createTaskFolderDialog.zEnterFolderName(_folderName);
    createTaskFolderDialog.zClickButton(Button.B_OK);

    _folderIsCreated = true;

    SleepUtil.sleepVerySmall();

    // refresh task page
    app.zTreeTasks.zTreeItem(Action.A_LEFTCLICK, taskFolder);

    // Make sure the task folder was created on the ZCS server
    FolderItem folder = FolderItem.importFromSOAP(app.zGetActiveAccount(), _folderName);
    ZAssert.assertNotNull(folder, "Verify task folder is created");
    ZAssert.assertEquals(
        folder.getName(), _folderName, "Verify the server and client folder names match");
  }
  @Test(
      description = "D1 Enhancement : Create a contact group with 3 contacts",
      groups = {"functional"})
  public void CreateContactGroupWith3Contacts() throws HarnessException {

    // -- Data

    // Create a contact
    ContactItem contact1 = ContactItem.createContactItem(app.zGetActiveAccount());
    ContactItem contact2 = ContactItem.createContactItem(app.zGetActiveAccount());
    ContactItem contact3 = ContactItem.createContactItem(app.zGetActiveAccount());

    // Create a contact group
    String groupname = "group" + ZimbraSeleniumProperties.getUniqueString();

    // -- GUI

    // Refresh
    app.zPageAddressbook.zRefresh();

    // Check 3 contact items
    app.zPageAddressbook.zListItem(Action.A_CHECKBOX, contact1.getName());
    app.zPageAddressbook.zListItem(Action.A_CHECKBOX, contact2.getName());
    app.zPageAddressbook.zListItem(Action.A_CHECKBOX, contact3.getName());

    // Right click on one contact -> Group -> Existing Group Name
    DialogNewContactGroup dialog =
        (DialogNewContactGroup)
            app.zPageAddressbook.zListItem(
                Action.A_RIGHTCLICK,
                Button.B_CONTACTGROUP,
                Button.O_NEW_CONTACTGROUP,
                contact1.getName());

    dialog.zEnterGroupName(groupname);
    dialog.zClickButton(Button.B_OK);

    // -- Verification

    // Verify the contact group is created
    ContactGroupItem actual = ContactGroupItem.importFromSOAP(app.zGetActiveAccount(), groupname);
    ZAssert.assertNotNull(actual, "Verify the contact group is created");

    // Verify the contact group contains the contact
    ZAssert.assertContains(
        actual.getMemberList(),
        new ContactGroupItem.MemberItemContact(contact1),
        "Verify the contact group conatins the contact");

    ZAssert.assertContains(
        actual.getMemberList(),
        new ContactGroupItem.MemberItemContact(contact2),
        "Verify the contact group conatins the contact");

    ZAssert.assertContains(
        actual.getMemberList(),
        new ContactGroupItem.MemberItemContact(contact3),
        "Verify the contact group conatins the contact");
  }
  @Test(
      description =
          "Delete a task by selecting and typing 'delete' keyboard-Verify Toast message through GUI",
      groups = {"smoke"},
      dataProvider = "DataProviderDeleteKeys")
  public void DeleteTaskToastMsg_03(String name, int keyEvent) throws HarnessException {

    FolderItem taskFolder = FolderItem.importFromSOAP(app.zGetActiveAccount(), SystemFolder.Tasks);

    // Create a basic task to delete
    String subject = "task" + ZimbraSeleniumProperties.getUniqueString();

    app.zGetActiveAccount()
        .soapSend(
            "<CreateTaskRequest xmlns='urn:zimbraMail'>"
                + "<m >"
                + "<inv>"
                + "<comp name='"
                + subject
                + "'>"
                + "<or a='"
                + app.zGetActiveAccount().EmailAddress
                + "'/>"
                + "</comp>"
                + "</inv>"
                + "<su>"
                + subject
                + "</su>"
                + "<mp ct='text/plain'>"
                + "<content>content"
                + ZimbraSeleniumProperties.getUniqueString()
                + "</content>"
                + "</mp>"
                + "</m>"
                + "</CreateTaskRequest>");

    GeneralUtility.syncDesktopToZcsWithSoap(app.zGetActiveAccount());

    TaskItem task = TaskItem.importFromSOAP(app.zGetActiveAccount(), subject);
    ZAssert.assertNotNull(task, "Verify the task is created");

    // Refresh the tasks view
    app.zPageTasks.zToolbarPressButton(Button.B_REFRESH);
    app.zTreeTasks.zTreeItem(Action.A_LEFTCLICK, taskFolder);

    // Select the item
    app.zPageTasks.zListItem(Action.A_MAIL_CHECKBOX, subject);

    // Click delete keyboard
    logger.info("Typing shortcut key " + name + " KeyEvent: " + keyEvent);
    app.zPageMail.zKeyboardKeyEvent(keyEvent);

    // Verifying the toaster message
    Toaster toast = app.zPageMain.zGetToaster();
    String toastMsg = toast.zGetToastMessage();
    ZAssert.assertStringContains(
        toastMsg, "1 task moved to Trash", "Verify toast message: Task Moved To trash");
  }
Exemple #10
0
  @Test(
      description = "Delete contact + contact group at once",
      groups = {"functional"})
  public void DeleteMixOfContactAndGroup() throws HarnessException {

    // Create a contact group via Soap
    ContactGroupItem group = ContactGroupItem.createContactGroupItem(app.zGetActiveAccount());

    group.setId(
        app.zGetActiveAccount().soapSelectValue("//mail:CreateContactResponse/mail:cn", "id"));
    String[] dlist =
        app.zGetActiveAccount()
            .soapSelectValue("//mail:CreateContactResponse/mail:cn/mail:a[@n='dlist']", null)
            .split(","); // a[2]
    for (int i = 0; i < dlist.length; i++) {
      group.addDListMember(dlist[i]);
    }

    // Create a contact via Soap
    ContactItem contactItem = ContactItem.createContactItem(app.zGetActiveAccount());
    contactItem.setId(
        app.zGetActiveAccount().soapSelectValue("//mail:CreateContactResponse/mail:cn", "id"));

    GeneralUtility.syncDesktopToZcsWithSoap(app.zGetActiveAccount());
    app.zPageAddressbook.zWaitForDesktopLoadingSpinner(5000);

    // Refresh the view, to pick up the newly created ones
    FolderItem contactFolder = FolderItem.importFromSOAP(app.zGetActiveAccount(), "Contacts");
    app.zTreeContacts.zTreeItem(Action.A_LEFTCLICK, contactFolder);

    // Select the items
    app.zPageAddressbook.zListItem(Action.A_CHECKBOX, group.fileAs);
    app.zPageAddressbook.zListItem(Action.A_CHECKBOX, contactItem.fileAs);

    // delete contact + group by click Delete button on toolbar
    app.zPageAddressbook.zToolbarPressButton(Button.B_DELETE);

    // verify toasted message 2 contacts moved to Trash
    String expectedMsg = "2 contacts moved to Trash";
    ZAssert.assertStringContains(
        app.zPageMain.zGetToaster().zGetToastMessage(),
        expectedMsg,
        "Verify toast message '" + expectedMsg + "'");

    // verify deleted contact + group not displayed
    List<ContactItem> contacts = app.zPageAddressbook.zListGetContacts();

    int count = 0;
    for (ContactItem ci : contacts) {
      if (ci.fileAs.equals(group.groupName) || ci.fileAs.equals(contactItem.fileAs)) {
        count++;
      }
    }

    ZAssert.assertTrue(
        count == 0,
        "Verify contact + group " + contactItem.fileAs + "," + group.groupName + " deleted");
  }
  @Test(
      description =
          "Create task through SOAP - delete using Backspace Key & verify Toast message through GUI",
      groups = {"functional"})
  public void DeleteTaskToastMsg_07() throws HarnessException {

    FolderItem taskFolder = FolderItem.importFromSOAP(app.zGetActiveAccount(), SystemFolder.Tasks);

    // Create a basic task to delete
    String subject = "task" + ZimbraSeleniumProperties.getUniqueString();

    app.zGetActiveAccount()
        .soapSend(
            "<CreateTaskRequest xmlns='urn:zimbraMail'>"
                + "<m >"
                + "<inv>"
                + "<comp name='"
                + subject
                + "'>"
                + "<or a='"
                + app.zGetActiveAccount().EmailAddress
                + "'/>"
                + "</comp>"
                + "</inv>"
                + "<su>"
                + subject
                + "</su>"
                + "<mp ct='text/plain'>"
                + "<content>content"
                + ZimbraSeleniumProperties.getUniqueString()
                + "</content>"
                + "</mp>"
                + "</m>"
                + "</CreateTaskRequest>");

    GeneralUtility.syncDesktopToZcsWithSoap(app.zGetActiveAccount());

    TaskItem task = TaskItem.importFromSOAP(app.zGetActiveAccount(), subject);
    ZAssert.assertNotNull(task, "Verify the task is created");

    // Refresh the tasks view
    app.zPageTasks.zToolbarPressButton(Button.B_REFRESH);
    app.zTreeTasks.zTreeItem(Action.A_LEFTCLICK, taskFolder);

    // Select the item
    app.zPageTasks.zListItem(Action.A_MAIL_CHECKBOX, subject);

    // Use Backspace Keyboard Shortcut
    app.zPageTasks.zKeyboardShortcut(Shortcut.S_BACKSPACE);

    // Verifying the toaster message
    Toaster toast = app.zPageMain.zGetToaster();
    String toastMsg = toast.zGetToastMessage();
    ZAssert.assertStringContains(
        toastMsg, "1 task moved to Trash", "Verify toast message: Task Moved to Trash");
  }
Exemple #12
0
  @Test(
      description = "Mark a message as unread by clicking on it, then using 'mu' hotkeys",
      groups = {"smoke"})
  public void MarkUnReadMail_01() throws HarnessException {

    // Create the message data to be sent
    String subject = "subject" + ZimbraSeleniumProperties.getUniqueString();

    FolderItem inboxFolder = FolderItem.importFromSOAP(app.zGetActiveAccount(), SystemFolder.Inbox);
    app.zGetActiveAccount()
        .soapSend(
            "<AddMsgRequest xmlns='urn:zimbraMail'>"
                + "<m l='"
                + inboxFolder.getId()
                + "' f=''>"
                + "<content>From: [email protected]\n"
                + "To: [email protected] \n"
                + "Subject: "
                + subject
                + "\n"
                + "MIME-Version: 1.0 \n"
                + "Content-Type: text/plain; charset=utf-8 \n"
                + "Content-Transfer-Encoding: 7bit\n"
                + "\n"
                + "simple text string in the body\n"
                + "</content>"
                + "</m>"
                + "</AddMsgRequest>");

    // Create a mail item to represent the message
    MailItem mail = MailItem.importFromSOAP(app.zGetActiveAccount(), "subject:(" + subject + ")");
    ZAssert.assertStringDoesNotContain(mail.getFlags(), "u", "Verify message is initially unread");

    // Click Get Mail button
    app.zPageMail.zToolbarPressButton(Button.B_GETMAIL);

    // Select the item
    app.zPageMail.zListItem(Action.A_LEFTCLICK, mail.dSubject);

    // TODO: need to L10N this
    app.zPageMail.zKeyboardShortcut(Shortcut.S_MAIL_MARKUNREAD);

    GeneralUtility.syncDesktopToZcsWithSoap(app.zGetActiveAccount());

    // Verify the message is marked read in the server (flags attribute should not contain (u)nread)
    mail = MailItem.importFromSOAP(app.zGetActiveAccount(), "subject:(" + subject + ")");
    ZAssert.assertStringContains(
        mail.getFlags(), "u", "Verify the message is marked read in the server");

    // TODO: Verify the message is not marked unread in the list

  }
  @Test(
      description = "Delete multiple messages (3) by select and toolbar delete",
      groups = {"functional"})
  public void DeleteConversation_05() throws HarnessException {

    // Create the message data to be sent
    ConversationItem c1 = ConversationItem.createConversationItem(app.zGetActiveAccount());
    ConversationItem c2 = ConversationItem.createConversationItem(app.zGetActiveAccount());
    ConversationItem c3 = ConversationItem.createConversationItem(app.zGetActiveAccount());

    // Click Get Mail button
    app.zPageMail.zToolbarPressButton(Button.B_GETMAIL);

    // Select all three items
    app.zPageMail.zListItem(Action.A_MAIL_CHECKBOX, c1.getSubject());
    app.zPageMail.zListItem(Action.A_MAIL_CHECKBOX, c2.getSubject());
    app.zPageMail.zListItem(Action.A_MAIL_CHECKBOX, c3.getSubject());

    // Click toolbar delete button
    app.zPageMail.zToolbarPressButton(Button.B_DELETE);

    // -- Verification

    // Check each message to verify they exist in the trash
    FolderItem trash =
        FolderItem.importFromSOAP(app.zGetActiveAccount(), FolderItem.SystemFolder.Trash);

    ConversationItem actual1 =
        ConversationItem.importFromSOAP(
            app.zGetActiveAccount(), "is:anywhere subject:" + c1.getSubject());
    for (MailItem m : actual1.getMessageList()) {
      ZAssert.assertEquals(
          m.dFolderId, trash.getId(), "Verify the conversation message is in the trash");
    }

    ConversationItem actual2 =
        ConversationItem.importFromSOAP(
            app.zGetActiveAccount(), "is:anywhere subject:" + c2.getSubject());
    for (MailItem m : actual2.getMessageList()) {
      ZAssert.assertEquals(
          m.dFolderId, trash.getId(), "Verify the conversation message is in the trash");
    }

    ConversationItem actual3 =
        ConversationItem.importFromSOAP(
            app.zGetActiveAccount(), "is:anywhere subject:" + c3.getSubject());
    for (MailItem m : actual3.getMessageList()) {
      ZAssert.assertEquals(
          m.dFolderId, trash.getId(), "Verify the conversation message is in the trash");
    }
  }
  @Test(
      description = "Edit a subfolder, change name and color Context menu -> Edit)",
      groups = {"functional"})
  public void ChangeNameColorOfSubFolder() throws HarnessException {

    // -- Data

    FolderItem contacts = FolderItem.importFromSOAP(app.zGetActiveAccount(), SystemFolder.Contacts);

    // Create a folder
    String name = "ab" + ZimbraSeleniumProperties.getUniqueString();
    String newname = "ab" + ZimbraSeleniumProperties.getUniqueString();

    app.zGetActiveAccount()
        .soapSend(
            "<CreateFolderRequest xmlns='urn:zimbraMail'>"
                + "<folder name='"
                + name
                + "' view='contact' l='"
                + contacts.getId()
                + "'/>"
                + "</CreateFolderRequest>");
    FolderItem folderItem = FolderItem.importFromSOAP(app.zGetActiveAccount(), name);

    // -- GUI

    // Refresh
    app.zPageAddressbook.zRefresh();

    // Change the folder's color using context menu
    DialogEditFolder dialog =
        (DialogEditFolder)
            app.zTreeContacts.zTreeItem(Action.A_RIGHTCLICK, Button.B_TREE_EDIT, folderItem);
    ZAssert.assertNotNull(dialog, "Verify the dialog opened");

    dialog.zSetNewColor(FolderColor.Orange);
    dialog.zSetNewName(newname);
    dialog.zClickButton(Button.B_OK);

    // -- Verification

    // Get the folder again
    FolderItem actual = FolderItem.importFromSOAP(app.zGetActiveAccount(), name);
    ZAssert.assertNull(actual, "Verify the old addressbook does not exist");

    actual = FolderItem.importFromSOAP(app.zGetActiveAccount(), newname);
    ZAssert.assertNotNull(actual, "Verify the new addressbook exists");
    ZAssert.assertEquals(
        actual.getColor(), "9", "Verify the color of the folder is set to orange (9)");
  }
Exemple #15
0
  @Test(
      description = "Delete a a top level briefcase folder - Right click, Delete",
      groups = {"smoke"})
  public void DeleteFolder_02() throws HarnessException {
    ZimbraAccount account = app.zGetActiveAccount();

    FolderItem briefcaseRootFolder = FolderItem.importFromSOAP(account, SystemFolder.Briefcase);

    FolderItem userRootFolder = FolderItem.importFromSOAP(account, SystemFolder.UserRoot);

    ZAssert.assertNotNull(userRootFolder, "Verify the user root folder is available");

    FolderItem trash = FolderItem.importFromSOAP(app.zGetActiveAccount(), SystemFolder.Trash);
    ZAssert.assertNotNull(trash, "Verify the trash is available");

    // Create a top level briefcase folder
    String briefcaseTopLevelFolderName = "folder" + ZimbraSeleniumProperties.getUniqueString();

    account.soapSend(
        "<CreateFolderRequest xmlns='urn:zimbraMail'>"
            + "<folder name='"
            + briefcaseTopLevelFolderName
            + "' l='"
            + userRootFolder.getId()
            + "' view='document'/>"
            + "</CreateFolderRequest>");

    FolderItem briefcaseTopLevelFolder =
        FolderItem.importFromSOAP(account, briefcaseTopLevelFolderName);
    ZAssert.assertNotNull(
        briefcaseTopLevelFolder, "Verify the briefcase top level folder is available");

    // refresh the Briefcase tree folder list
    app.zTreeBriefcase.zTreeItem(Action.A_LEFTCLICK, briefcaseRootFolder, false);

    // Delete the folder using context menu
    app.zTreeBriefcase.zTreeItem(
        Action.A_RIGHTCLICK, Button.B_TREE_DELETE, briefcaseTopLevelFolder);

    // Verify the folder is now in the trash
    briefcaseTopLevelFolder =
        FolderItem.importFromSOAP(app.zGetActiveAccount(), briefcaseTopLevelFolderName);
    ZAssert.assertNotNull(
        briefcaseTopLevelFolder, "Verify the briefcase top level folder is again available");
    ZAssert.assertEquals(
        trash.getId(),
        briefcaseTopLevelFolder.getParentId(),
        "Verify the deleted briefcase top level folder's parent is now the trash folder ID");
  }
  @Test(
      description = "Rename a folder - Context menu -> Rename",
      groups = {"smoke"})
  public void RenameFolder_01() throws HarnessException {

    FolderItem inbox = FolderItem.importFromSOAP(app.zGetActiveAccount(), SystemFolder.Inbox);
    ZAssert.assertNotNull(inbox, "Verify the inbox is available");

    // Create the subfolder
    String name1 = "folder" + ZimbraSeleniumProperties.getUniqueString();

    app.zGetActiveAccount()
        .soapSend(
            "<CreateFolderRequest xmlns='urn:zimbraMail'>"
                + "<folder name='"
                + name1
                + "' l='"
                + inbox.getId()
                + "'/>"
                + "</CreateFolderRequest>");

    FolderItem subfolder1 = FolderItem.importFromSOAP(app.zGetActiveAccount(), name1);
    ZAssert.assertNotNull(subfolder1, "Verify the subfolder is available");

    // Click on Get Mail to refresh the folder list
    app.zPageMail.zToolbarPressButton(Button.B_GETMAIL);

    // Rename the folder using context menu
    DialogRenameFolder dialog =
        (DialogRenameFolder)
            app.zTreeMail.zTreeItem(Action.A_RIGHTCLICK, Button.B_RENAME, subfolder1);
    ZAssert.assertNotNull(dialog, "Verify the dialog opened");

    // Set the name, click OK
    String name2 = "folder" + ZimbraSeleniumProperties.getUniqueString();
    dialog.zSetNewName(name2);
    dialog.zClickButton(Button.B_OK);

    // Get all the folders and verify the new name appears and the old name disappears
    app.zGetActiveAccount().soapSend("<GetFolderRequest xmlns = 'urn:zimbraMail'/>");

    Element[] eFolder1 =
        app.zGetActiveAccount().soapSelectNodes("//mail:folder[@name='" + name1 + "']");
    ZAssert.assertEquals(eFolder1.length, 0, "Verify the old folder name no longer exists");

    Element[] eFolder2 =
        app.zGetActiveAccount().soapSelectNodes("//mail:folder[@name='" + name2 + "']");
    ZAssert.assertEquals(eFolder2.length, 1, "Verify the new folder name exists");
  }
  @Test(
      description = "Delete a conversation by selecting and typing 'delete' keyboard",
      groups = {"functional"},
      dataProvider = "DataProviderDeleteKeys")
  public void DeleteConversation_03(String name, int keyEvent) throws HarnessException {

    // Create the message data to be sent
    ConversationItem c = ConversationItem.createConversationItem(app.zGetActiveAccount());

    // Click Get Mail button
    app.zPageMail.zToolbarPressButton(Button.B_GETMAIL);

    // Check the item
    app.zPageMail.zListItem(Action.A_LEFTCLICK, c.getSubject());

    // Click delete
    logger.info("Typing shortcut key " + name + " KeyEvent: " + keyEvent);
    app.zPageMail.zKeyboardKeyEvent(keyEvent);

    // -- Verification

    // Check each message to verify they exist in the trash
    FolderItem trash =
        FolderItem.importFromSOAP(app.zGetActiveAccount(), FolderItem.SystemFolder.Trash);
    ConversationItem actual =
        ConversationItem.importFromSOAP(
            app.zGetActiveAccount(), "is:anywhere subject:" + c.getSubject());

    for (MailItem m : actual.getMessageList()) {
      ZAssert.assertEquals(
          m.dFolderId, trash.getId(), "Verify the conversation message is in the trash");
    }
  }
  @Bugs(ids = "53564")
  @Test(
      description = "Hard-delete a mail by selecting and typing 'shift-del' shortcut",
      groups = {"functional"})
  public void HardDeleteConversation_01() throws HarnessException {

    // Create the message data to be sent
    ConversationItem c = ConversationItem.createConversationItem(app.zGetActiveAccount());

    // Click Get Mail button
    app.zPageMail.zToolbarPressButton(Button.B_GETMAIL);

    // Check the item
    app.zPageMail.zListItem(Action.A_LEFTCLICK, c.getSubject());

    // Click shift-delete
    DialogWarning dialog =
        (DialogWarning) app.zPageMail.zKeyboardShortcut(Shortcut.S_MAIL_HARDELETE);
    dialog.zClickButton(Button.B_OK);

    // Verify the message is no longer in the mailbox
    app.zGetActiveAccount()
        .soapSend(
            "<SearchRequest xmlns='urn:zimbraMail' types='conversation'>"
                + "<query>subject:("
                + c.getSubject()
                + ") is:anywhere</query>"
                + "</SearchRequest>");

    Element[] nodes = app.zGetActiveAccount().soapSelectNodes("//mail:c");
    ZAssert.assertEquals(nodes.length, 0, "Verify the converastion is no longer in the mailbox");
  }
  @Test(
      description = "Delete a mail using context menu delete button",
      groups = {"functional"})
  public void DeleteConversation_06() throws HarnessException {

    // Create the message data to be sent
    ConversationItem c = ConversationItem.createConversationItem(app.zGetActiveAccount());

    // Click Get Mail button
    app.zPageMail.zToolbarPressButton(Button.B_GETMAIL);

    // Right click the item, select delete
    app.zPageMail.zListItem(Action.A_RIGHTCLICK, Button.B_DELETE, c.getSubject());

    // -- Verification

    // Check each message to verify they exist in the trash
    FolderItem trash =
        FolderItem.importFromSOAP(app.zGetActiveAccount(), FolderItem.SystemFolder.Trash);
    ConversationItem actual =
        ConversationItem.importFromSOAP(
            app.zGetActiveAccount(), "is:anywhere subject:" + c.getSubject());

    for (MailItem m : actual.getMessageList()) {
      ZAssert.assertEquals(
          m.dFolderId, trash.getId(), "Verify the conversation message is in the trash");
    }
  }
  @Test(
      description = "Delete a conversation by selecting and typing '.t' shortcut",
      groups = {"functional"})
  public void DeleteConversation_04() throws HarnessException {

    // Create the message data to be sent
    ConversationItem c = ConversationItem.createConversationItem(app.zGetActiveAccount());

    // Click Get Mail button
    app.zPageMail.zToolbarPressButton(Button.B_GETMAIL);

    // Check the item
    app.zPageMail.zListItem(Action.A_LEFTCLICK, c.getSubject());

    // Click delete
    app.zPageMail.zKeyboardShortcut(Shortcut.S_MAIL_MOVETOTRASH);

    // -- Verification

    // Check each message to verify they exist in the trash
    FolderItem trash =
        FolderItem.importFromSOAP(app.zGetActiveAccount(), FolderItem.SystemFolder.Trash);
    ConversationItem actual =
        ConversationItem.importFromSOAP(
            app.zGetActiveAccount(), "is:anywhere subject:" + c.getSubject());

    for (MailItem m : actual.getMessageList()) {
      ZAssert.assertEquals(
          m.dFolderId, trash.getId(), "Verify the conversation message is in the trash");
    }
  }
  @Test(
      description = "D1 Enhancement : Add 1 contact + 1 group to an existing group",
      groups = {"functional"})
  public void Add1ContactAnd1GroupToExistingGroup() throws HarnessException {

    // -- Data

    // Create a contact
    ContactItem contact = ContactItem.createContactItem(app.zGetActiveAccount());

    // Create a contact group
    ContactGroupItem group1 = ContactGroupItem.createContactGroupItem(app.zGetActiveAccount());
    ContactGroupItem group2 = ContactGroupItem.createContactGroupItem(app.zGetActiveAccount());

    // -- GUI

    // Refresh
    app.zPageAddressbook.zRefresh();

    // Check 3 contact items
    app.zPageAddressbook.zListItem(Action.A_CHECKBOX, contact.getName());
    app.zPageAddressbook.zListItem(Action.A_CHECKBOX, group1.getName());

    // Right click on one contact -> Group -> Existing Group Name
    app.zPageAddressbook.zListItem(
        Action.A_RIGHTCLICK, Button.B_CONTACTGROUP, group2, contact.getName());

    // -- Verification

    // Verify the contact group is created
    ContactGroupItem actual =
        ContactGroupItem.importFromSOAP(app.zGetActiveAccount(), group1.getName());
    ZAssert.assertNotNull(actual, "Verify the contact group is created");

    // Verify the contact group contains the contact
    ZAssert.assertContains(
        actual.getMemberList(),
        new ContactGroupItem.MemberItemContact(contact),
        "Verify the contact group conatins the contact");

    // The group members will be added to the new group
    for (ContactGroupItem.MemberItem m : group1.getMemberList()) {
      ZAssert.assertContains(
          actual.getMemberList(), m, "Verify the contact group contains the group members");
    }
  }
  @Test(
      description = "Double tag a group ",
      groups = {"functional"})
  public void DoubleTag() throws HarnessException {

    // -- Data

    // Create a tag
    TagItem tag1 = TagItem.CreateUsingSoap(app.zGetActiveAccount());
    TagItem tag2 = TagItem.CreateUsingSoap(app.zGetActiveAccount());

    // Create a contact group via Soap then select
    ContactGroupItem group = ContactGroupItem.createContactGroupItem(app.zGetActiveAccount());

    // -- GUI

    // Refresh
    app.zPageAddressbook.zRefresh();

    // Select the contact group
    app.zPageAddressbook.zListItem(Action.A_LEFTCLICK, group.getName());

    // Tag -> Existing Tag
    app.zPageAddressbook.zToolbarPressPulldown(Button.B_TAG, tag1);
    app.zPageAddressbook.zToolbarPressPulldown(Button.B_TAG, tag2);

    // -- Verification

    app.zGetActiveAccount()
        .soapSend(
            "<GetContactsRequest xmlns='urn:zimbraMail' >"
                + "<cn id='"
                + group.getId()
                + "'/>"
                + "</GetContactsRequest>");

    String t = app.zGetActiveAccount().soapSelectValue("//mail:cn", "t");
    ZAssert.assertNotNull(t, "Verify the contact has tags");
    ZAssert.assertStringContains(
        t, tag1.getId(), "Verify the contact is tagged with the correct tag");
    ZAssert.assertStringContains(
        t, tag2.getId(), "Verify the contact is tagged with the correct tag");
  }
  @Test(
      description = "Tag a contact group, click pulldown menu Tag->New Tag",
      groups = {"smoke"})
  public void ClickPulldownMenuTagNewTag() throws HarnessException {

    // -- Data

    // Create a tag
    String tagName = "tag" + ZimbraSeleniumProperties.getUniqueString();

    // Create a contact group via Soap then select
    ContactGroupItem group = ContactGroupItem.createContactGroupItem(app.zGetActiveAccount());

    // -- GUI

    // Refresh
    app.zPageAddressbook.zRefresh();

    // Select the contact
    app.zPageAddressbook.zListItem(Action.A_LEFTCLICK, group.getName());

    // click Tag Contact->New Tag
    DialogTag dialogTag =
        (DialogTag)
            app.zPageAddressbook.zListItem(
                Action.A_RIGHTCLICK, Button.B_TAG, Button.O_TAG_NEWTAG, group.getName());
    dialogTag.zSetTagName(tagName);
    dialogTag.zClickButton(Button.B_OK);

    // -- Verification

    app.zGetActiveAccount()
        .soapSend(
            "<GetContactsRequest xmlns='urn:zimbraMail' >"
                + "<cn id='"
                + group.getId()
                + "'/>"
                + "</GetContactsRequest>");

    String tn = app.zGetActiveAccount().soapSelectValue("//mail:cn", "tn");
    ZAssert.assertNotNull(tn, "Verify the contact has tags");
    ZAssert.assertStringContains(tn, tagName, "Verify the contact is tagged with the correct tag");
  }
  @Test(
      description = "Rename a folder - set to an invalid name with ':'",
      groups = {"functional"})
  public void RenameFolder_02() throws HarnessException {

    FolderItem inbox = FolderItem.importFromSOAP(app.zGetActiveAccount(), SystemFolder.Inbox);
    ZAssert.assertNotNull(inbox, "Verify the inbox is available");

    // Create the subfolder
    String name1 = "folder" + ZimbraSeleniumProperties.getUniqueString();

    app.zGetActiveAccount()
        .soapSend(
            "<CreateFolderRequest xmlns='urn:zimbraMail'>"
                + "<folder name='"
                + name1
                + "' l='"
                + inbox.getId()
                + "'/>"
                + "</CreateFolderRequest>");

    FolderItem subfolder1 = FolderItem.importFromSOAP(app.zGetActiveAccount(), name1);
    ZAssert.assertNotNull(subfolder1, "Verify the subfolder is available");

    // Click on Get Mail to refresh the folder list
    app.zPageMail.zToolbarPressButton(Button.B_GETMAIL);

    // Rename the folder using context menu
    DialogRenameFolder dialog =
        (DialogRenameFolder)
            app.zTreeMail.zTreeItem(Action.A_RIGHTCLICK, Button.B_RENAME, subfolder1);
    ZAssert.assertNotNull(dialog, "Verify the dialog opened");

    // Set the name, click OK
    String name2 = "folder:folder" + ZimbraSeleniumProperties.getUniqueString();
    dialog.zSetNewName(name2);
    dialog.zClickButton(Button.B_OK);

    DialogError error = app.zPageMain.zGetErrorDialog(DialogErrorID.InvalidFolderName);
    ZAssert.assertTrue(error.zIsActive(), "Verify the error dialog appears");

    error.zClickButton(Button.B_OK);
  }
  @Test(
      description = "Create a new contact group by right click on existing contact",
      groups = {"smoke"})
  public void CreateContactGroupWith1Contact() throws HarnessException {

    // -- Data

    // Create a contact
    ContactItem contact = ContactItem.createContactItem(app.zGetActiveAccount());

    // The contact group name
    String groupname = "group" + ZimbraSeleniumProperties.getUniqueString();

    // -- GUI

    // Refresh
    app.zPageAddressbook.zRefresh();

    // Right click on the contact
    DialogNewContactGroup dialog =
        (DialogNewContactGroup)
            app.zPageAddressbook.zListItem(
                Action.A_RIGHTCLICK,
                Button.B_CONTACTGROUP,
                Button.O_NEW_CONTACTGROUP,
                contact.firstName);

    dialog.zEnterGroupName(groupname);
    dialog.zClickButton(Button.B_OK);

    // -- Verification

    // Verify the contact group is created
    ContactGroupItem actual = ContactGroupItem.importFromSOAP(app.zGetActiveAccount(), groupname);
    ZAssert.assertNotNull(actual, "Verify the contact group is created");

    // Verify the contact group contains the contact
    ZAssert.assertContains(
        actual.getMemberList(),
        new ContactGroupItem.MemberItemContact(contact),
        "Verify the contact group conatins the contact");
  }
Exemple #26
0
  private void _verifyContactGroupDeleted(ContactGroupItem group) throws HarnessException {
    // verify toasted message 1 contact group moved to Trash
    String expectedMsg = "1 contact group moved to Trash";
    ZAssert.assertStringContains(
        app.zPageMain.zGetToaster().zGetToastMessage(),
        expectedMsg,
        "Verify toast message '" + expectedMsg + "'");

    // verify deleted contact group not displayed
    List<ContactItem> contacts = app.zPageAddressbook.zListGetContacts();

    boolean isFileAsEqual = false;
    for (ContactItem ci : contacts) {
      if (ci.fileAs.equals(group.groupName)) {
        isFileAsEqual = true;
        break;
      }
    }

    ZAssert.assertFalse(isFileAsEqual, "Verify contact group " + group.groupName + " deleted");

    FolderItem trash = FolderItem.importFromSOAP(app.zGetActiveAccount(), SystemFolder.Trash);

    // verify deleted contact displayed in trash folder
    // refresh Trash folder
    app.zTreeContacts.zTreeItem(Action.A_LEFTCLICK, trash);

    contacts = app.zPageAddressbook.zListGetContacts();

    isFileAsEqual = false;
    for (ContactItem ci : contacts) {
      if (ci.fileAs.equals(group.groupName)) {
        isFileAsEqual = true;
        break;
      }
    }

    ZAssert.assertTrue(
        isFileAsEqual, "Verify contact group (" + group.groupName + ") displayed in Trash folder");
  }
  @Test(
      description = "Tag a contact group by dnd on an existing tag",
      groups = {"functional"})
  public void DnDOnExistingTag() throws HarnessException {

    // -- Data

    // Create a tag
    TagItem tagItem = TagItem.CreateUsingSoap(app.zGetActiveAccount());

    // Create a contact group via Soap then select
    ContactGroupItem group = ContactGroupItem.createContactGroupItem(app.zGetActiveAccount());

    // -- GUI

    // Refresh
    app.zPageAddressbook.zRefresh();

    // Dnd on the new tag
    app.zPageAddressbook.zDragAndDrop(
        "css=[id=zlif__CNS-main__" + group.getId() + "__fileas]:contains(" + group.getName() + ")",
        "css=div[id=main_Contacts-parent-TAG] div[id=ztih__main_Contacts__TAG] td[id^=zti__main_Contacts__][id$=_textCell]:contains("
            + tagItem.getName()
            + ")");

    // -- Verification

    app.zGetActiveAccount()
        .soapSend(
            "<GetContactsRequest xmlns='urn:zimbraMail' >"
                + "<cn id='"
                + group.getId()
                + "'/>"
                + "</GetContactsRequest>");

    String t = app.zGetActiveAccount().soapSelectValue("//mail:cn", "t");
    ZAssert.assertNotNull(t, "Verify the contact has tags");
    ZAssert.assertStringContains(
        t, tagItem.getId(), "Verify the contact is tagged with the correct tag");
  }
  @Test(
      description = "Mark a message as read by clicking on it then waiting",
      groups = {"smoke"})
  public void MarkReadMail_01() throws HarnessException {

    // Create the message data to be sent
    String subject = "subject" + ZimbraSeleniumProperties.getUniqueString();

    ZimbraAccount.AccountA()
        .soapSend(
            "<SendMsgRequest xmlns='urn:zimbraMail'>"
                + "<m>"
                + "<e t='t' a='"
                + app.zGetActiveAccount().EmailAddress
                + "'/>"
                + "<su>"
                + subject
                + "</su>"
                + "<mp ct='text/plain'>"
                + "<content>content"
                + ZimbraSeleniumProperties.getUniqueString()
                + "</content>"
                + "</mp>"
                + "</m>"
                + "</SendMsgRequest>");

    // Create a mail item to represent the message
    MailItem mail = MailItem.importFromSOAP(app.zGetActiveAccount(), "subject:(" + subject + ")");

    // Click Get Mail button
    app.zPageMail.zToolbarPressButton(Button.B_GETMAIL);

    // Select the item
    app.zPageMail.zListItem(Action.A_LEFTCLICK, mail.dSubject);

    // Wait to read the message
    SleepUtil.sleep(1000L * (delaySeconds));

    // Wait the for the client to send the change to the server
    app.zPageMail.zWaitForBusyOverlay();

    // Verify the message is marked read in the server (flags attribute should not contain (u)nread)
    mail = MailItem.importFromSOAP(app.zGetActiveAccount(), "subject:(" + subject + ")");
    ZAssert.assertStringDoesNotContain(
        mail.getFlags(), "u", "Verify the message is marked read in the server");

    // TODO: Verify the message is not marked unread in the list

  }
Exemple #29
0
  // verify contact tagged with tag and toasted message
  private void Verify(ContactItem contactItem, String tagName) throws HarnessException {
    // Make sure the tag was created on the server (get the tag ID)
    app.zGetActiveAccount().soapSend("<GetTagRequest xmlns='urn:zimbraMail'/>");
    ;
    String tagID =
        app.zGetActiveAccount()
            .soapSelectValue("//mail:GetTagResponse//mail:tag[@name='" + tagName + "']", "id");

    // Make sure the tag was applied to the contact
    app.zGetActiveAccount()
        .soapSend(
            "<GetContactsRequest xmlns='urn:zimbraMail'>"
                + "<cn id='"
                + contactItem.getId()
                + "'/>"
                + "</GetContactsRequest>");

    String contactTags =
        app.zGetActiveAccount().soapSelectValue("//mail:GetContactsResponse//mail:cn", "t");

    // if multi-tagged
    if (contactTags.contains(",")) {
      ZAssert.assertStringContains(
          contactTags, tagID, "Verify the tag appears on the contact id=" + contactItem.getId());
    } else {
      ZAssert.assertEquals(
          contactTags, tagID, "Verify the tag appears on the contact id=" + contactItem.getId());
    }
    // verify toasted message '1 contact tagged ...'
    Toaster toast = app.zPageMain.zGetToaster();
    String toastMsg = toast.zGetToastMessage();
    ZAssert.assertStringContains(
        toastMsg,
        "1 contact tagged \"" + tagName + "\"",
        "Verify toast message '" + "1 contact tagged \"" + tagName + "\"'");
  }
  @Test(
      description = "Right click then click Tag Contact Group->a tag name",
      groups = {"functional"})
  public void ClickContextMenuTagContactExistingTag() throws HarnessException {

    // -- Data

    // Create a tag
    TagItem tagItem = TagItem.CreateUsingSoap(app.zGetActiveAccount());

    // Create a contact group via Soap then select
    ContactGroupItem group = ContactGroupItem.createContactGroupItem(app.zGetActiveAccount());

    // -- GUI

    // Refresh
    app.zPageAddressbook.zRefresh();

    // Right Click -> Tag -> Existing Tag
    app.zPageAddressbook.zListItem(Action.A_RIGHTCLICK, Button.B_TAG, tagItem, group.getName());

    // -- Verification

    app.zGetActiveAccount()
        .soapSend(
            "<GetContactsRequest xmlns='urn:zimbraMail' >"
                + "<cn id='"
                + group.getId()
                + "'/>"
                + "</GetContactsRequest>");

    String t = app.zGetActiveAccount().soapSelectValue("//mail:cn", "t");
    ZAssert.assertNotNull(t, "Verify the contact has tags");
    ZAssert.assertStringContains(
        t, tagItem.getId(), "Verify the contact is tagged with the correct tag");
  }