Ejemplo n.º 1
0
  @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");
  }
Ejemplo n.º 2
0
  @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");
  }
Ejemplo n.º 3
0
  @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)");
  }
Ejemplo n.º 4
0
  @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");
  }
Ejemplo n.º 5
0
  @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

  }
  @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");
  }
Ejemplo n.º 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");
  }
Ejemplo n.º 8
0
  @Test(
      description = "Double tag a contact ",
      groups = {"functional"})
  public void DoubleTag() throws HarnessException {
    // Create a new tag
    TagItem tagItem = TagItem.CreateUsingSoap(app);

    // Create a contact via Soap then select
    ContactItem contactItem =
        app.zPageAddressbook.createUsingSOAPSelectContact(app, Action.A_LEFTCLICK);

    // select the tag
    app.zPageAddressbook.zToolbarPressPulldown(Button.B_TAG, tagItem);

    Verify(contactItem, tagItem.getName());

    // create a new tag name
    String tagName = "tag" + ZimbraSeleniumProperties.getUniqueString();

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

    Verify(contactItem, tagName);
  }
Ejemplo n.º 9
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 + "'");
  }
Ejemplo n.º 10
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");
  }
  @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");
  }
Ejemplo n.º 12
0
  @Test(
      description = "Mark a message as read by clicking on it, then using 'mr' hotkeys",
      groups = {"functional"})
  public void MarkReadMail_03() 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);

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

    // 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

  }
Ejemplo n.º 13
0
  @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);
  }
Ejemplo n.º 14
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

  }
Ejemplo n.º 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");
  }
Ejemplo n.º 16
0
  @Test(
      description = "Mark a message as read by context menu -> mark read",
      groups = {"functional"})
  public void MarkReadMail_04() 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);
    app.zPageMail.zListItem(Action.A_RIGHTCLICK, Button.O_MARK_AS_READ, mail.dSubject);
    // 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");
  }
Ejemplo n.º 17
0
  @Test(
      description = "Tag a contact, click pulldown menu Tag->New Tag",
      groups = {"smoke"})
  public void ClickPulldownMenuTagNewTag() throws HarnessException {

    // Create a contact via Soap then select
    ContactItem contactItem =
        app.zPageAddressbook.createUsingSOAPSelectContact(app, Action.A_LEFTCLICK);

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

    // Click new tag
    DialogTag dialogTag =
        (DialogTag) app.zPageAddressbook.zToolbarPressPulldown(Button.B_TAG, Button.O_TAG_NEWTAG);
    dialogTag.zSetTagName(tagName);
    dialogTag.zClickButton(Button.B_OK);

    Verify(contactItem, tagName);
  }
Ejemplo n.º 18
0
  @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 = "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");
  }
Ejemplo n.º 20
0
  @Test(
      description = "Right click then click Tag Contact->New Tag",
      groups = {"smoke"})
  public void ClickContextMenuTagContactNewTag() throws HarnessException {
    // Create a contact via Soap then select
    ContactItem contactItem =
        app.zPageAddressbook.createUsingSOAPSelectContact(app, Action.A_LEFTCLICK);

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

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

    Verify(contactItem, tagName);
  }
Ejemplo n.º 21
0
  @Test(
      description = "Verify bug 13911",
      groups = {"functional"})
  public void Bug_13911() throws HarnessException {

    String subject = "subject13010064065623";
    String bodyBeforeImage = "K\u00e6re alle";
    String bodyAfterImage = "Problemet best\u00E5r";

    String MimeFolder =
        ZimbraSeleniumProperties.getBaseDirectory() + "/data/private/mime/Bugs/Bug13911";
    LmtpInject.injectFile(ZimbraAccount.AccountZWC().EmailAddress, new File(MimeFolder));

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

    // Select the message so that it shows in the reading pane
    DisplayMail display = (DisplayMail) app.zPageMail.zListItem(Action.A_LEFTCLICK, subject);

    String body = display.zGetMailProperty(Field.Body);

    ZAssert.assertStringContains(body, bodyBeforeImage, "Verify the text before the image");
    ZAssert.assertStringContains(body, bodyAfterImage, "Verify the text after the image");
  }
Ejemplo n.º 22
0
  @Test(
      description = "Verify Permission Denied on Spam a shared mail (read-only share)",
      groups = {"functional"})
  public void MarkSpamMessage_01() throws HarnessException {
    String foldername = "folder" + ZimbraSeleniumProperties.getUniqueString();
    String subject = "subject" + ZimbraSeleniumProperties.getUniqueString();
    String mountpointname = "mountpoint" + ZimbraSeleniumProperties.getUniqueString();

    FolderItem inbox =
        FolderItem.importFromSOAP(ZimbraAccount.AccountA(), FolderItem.SystemFolder.Inbox);

    // Create a folder to share
    ZimbraAccount.AccountA()
        .soapSend(
            "<CreateFolderRequest xmlns='urn:zimbraMail'>"
                + "<folder name='"
                + foldername
                + "' l='"
                + inbox.getId()
                + "'/>"
                + "</CreateFolderRequest>");

    FolderItem folder = FolderItem.importFromSOAP(ZimbraAccount.AccountA(), foldername);

    // Share it
    ZimbraAccount.AccountA()
        .soapSend(
            "<FolderActionRequest xmlns='urn:zimbraMail'>"
                + "<action id='"
                + folder.getId()
                + "' op='grant'>"
                + "<grant d='"
                + app.zGetActiveAccount().EmailAddress
                + "' gt='usr' perm='r'/>"
                + "</action>"
                + "</FolderActionRequest>");

    // Add a message to it
    ZimbraAccount.AccountA()
        .soapSend(
            "<AddMsgRequest xmlns='urn:zimbraMail'>"
                + "<m l='"
                + folder.getId()
                + "' >"
                + "<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>");

    MailItem mail = MailItem.importFromSOAP(ZimbraAccount.AccountA(), "subject:(" + subject + ")");

    // Mount it
    app.zGetActiveAccount()
        .soapSend(
            "<CreateMountpointRequest xmlns='urn:zimbraMail'>"
                + "<link l='1' name='"
                + mountpointname
                + "'  rid='"
                + folder.getId()
                + "' zid='"
                + ZimbraAccount.AccountA().ZimbraId
                + "'/>"
                + "</CreateMountpointRequest>");

    FolderMountpointItem mountpoint =
        FolderMountpointItem.importFromSOAP(app.zGetActiveAccount(), mountpointname);

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

    // Click on the mountpoint
    app.zTreeMail.zTreeItem(Action.A_LEFTCLICK, mountpoint);

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

    // Verify that the toolbar button is disabled
    String locator = "css=div[id='ztb__TV-main'] div[id='zb__TV-main__SPAM']";

    ZAssert.assertTrue(
        app.zPageMail.sIsElementPresent(locator), "Verify the spam button is present");

    ZAssert.assertTrue(
        app.zPageMail.sIsElementPresent(locator + "[class*='ZDisabled']"),
        "Verify the spam button is disabled");
  }
Ejemplo n.º 23
0
  @Bugs(ids = "63796")
  @Test(
      description =
          "Verify Permission Denied on Spam (keyboard='ms') a shared mail (read-only share)",
      groups = {"functional"})
  public void MarkSpamMessage_02() throws HarnessException {
    String foldername = "folder" + ZimbraSeleniumProperties.getUniqueString();
    String subject = "subject" + ZimbraSeleniumProperties.getUniqueString();
    String mountpointname = "mountpoint" + ZimbraSeleniumProperties.getUniqueString();

    FolderItem inbox =
        FolderItem.importFromSOAP(ZimbraAccount.AccountA(), FolderItem.SystemFolder.Inbox);

    // Create a folder to share
    ZimbraAccount.AccountA()
        .soapSend(
            "<CreateFolderRequest xmlns='urn:zimbraMail'>"
                + "<folder name='"
                + foldername
                + "' l='"
                + inbox.getId()
                + "'/>"
                + "</CreateFolderRequest>");

    FolderItem folder = FolderItem.importFromSOAP(ZimbraAccount.AccountA(), foldername);

    // Share it
    ZimbraAccount.AccountA()
        .soapSend(
            "<FolderActionRequest xmlns='urn:zimbraMail'>"
                + "<action id='"
                + folder.getId()
                + "' op='grant'>"
                + "<grant d='"
                + app.zGetActiveAccount().EmailAddress
                + "' gt='usr' perm='r'/>"
                + "</action>"
                + "</FolderActionRequest>");

    // Add a message to it
    ZimbraAccount.AccountA()
        .soapSend(
            "<AddMsgRequest xmlns='urn:zimbraMail'>"
                + "<m l='"
                + folder.getId()
                + "' >"
                + "<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>");

    MailItem mail = MailItem.importFromSOAP(ZimbraAccount.AccountA(), "subject:(" + subject + ")");

    // Mount it
    app.zGetActiveAccount()
        .soapSend(
            "<CreateMountpointRequest xmlns='urn:zimbraMail'>"
                + "<link l='1' name='"
                + mountpointname
                + "'  rid='"
                + folder.getId()
                + "' zid='"
                + ZimbraAccount.AccountA().ZimbraId
                + "'/>"
                + "</CreateMountpointRequest>");

    FolderMountpointItem mountpoint =
        FolderMountpointItem.importFromSOAP(app.zGetActiveAccount(), mountpointname);

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

    // For some reason, it takes a bit of time for this share to show up
    SleepUtil.sleepMedium();

    // Click on the mountpoint
    app.zTreeMail.zTreeItem(Action.A_LEFTCLICK, mountpoint);

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

    // Spam the item
    app.zPageMail.zKeyboardShortcut(Shortcut.S_MAIL_MARKSPAM);

    // http://bugzilla.zimbra.com/show_bug.cgi?id=63796
    // A "Permission Denied" error popup should not occur
    DialogError dialog = app.zPageMain.zGetErrorDialog(DialogError.DialogErrorID.Zimbra);
    ZAssert.assertNotNull(dialog, "Verify the PERM DENIED Error Dialog is created");
    ZAssert.assertFalse(dialog.zIsActive(), "Verify the PERM DENIED Error Dialog is not active");

    // Verify the message is still in the owner's folder
    mail = MailItem.importFromSOAP(ZimbraAccount.AccountA(), "subject:(" + subject + ")");
    ZAssert.assertEquals(
        mail.dFolderId, folder.getId(), "Verify the message is still in the owner's folder");
  }
Ejemplo n.º 24
0
  @Test(
      description = "Mark all messages as read in folder (context menu)",
      groups = {"functional"})
  public void MarkAllAsReadMountpoint_01() throws HarnessException {
    String foldername = "folder" + ZimbraSeleniumProperties.getUniqueString();
    String subject = "subject" + ZimbraSeleniumProperties.getUniqueString();
    String mountpointname = "mountpoint" + ZimbraSeleniumProperties.getUniqueString();

    FolderItem inbox =
        FolderItem.importFromSOAP(ZimbraAccount.AccountA(), FolderItem.SystemFolder.Inbox);

    // Create a folder to share
    ZimbraAccount.AccountA()
        .soapSend(
            "<CreateFolderRequest xmlns='urn:zimbraMail'>"
                + "<folder name='"
                + foldername
                + "' l='"
                + inbox.getId()
                + "'/>"
                + "</CreateFolderRequest>");

    FolderItem folder = FolderItem.importFromSOAP(ZimbraAccount.AccountA(), foldername);

    // Share it
    ZimbraAccount.AccountA()
        .soapSend(
            "<FolderActionRequest xmlns='urn:zimbraMail'>"
                + "<action id='"
                + folder.getId()
                + "' op='grant'>"
                + "<grant d='"
                + app.zGetActiveAccount().EmailAddress
                + "' gt='usr' perm='rwidxa'/>"
                + "</action>"
                + "</FolderActionRequest>");

    // Add a message to it
    ZimbraAccount.AccountA()
        .soapSend(
            "<AddMsgRequest xmlns='urn:zimbraMail'>"
                + "<m l='"
                + folder.getId()
                + "' f='u'>"
                + "<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>");

    // Mount it
    app.zGetActiveAccount()
        .soapSend(
            "<CreateMountpointRequest xmlns='urn:zimbraMail'>"
                + "<link l='1' name='"
                + mountpointname
                + "'  rid='"
                + folder.getId()
                + "' zid='"
                + ZimbraAccount.AccountA().ZimbraId
                + "'/>"
                + "</CreateMountpointRequest>");

    FolderMountpointItem mountpoint =
        FolderMountpointItem.importFromSOAP(app.zGetActiveAccount(), mountpointname);

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

    // Right click on folder, select "Mark all as read"
    app.zTreeMail.zTreeItem(Action.A_RIGHTCLICK, Button.B_TREE_FOLDER_MARKASREAD, mountpoint);

    // Make sure the folder was created on the server
    MailItem mail = MailItem.importFromSOAP(ZimbraAccount.AccountA(), "subject:(" + subject + ")");
    ZAssert.assertNotNull(mail, "Verify the message exists");
    ZAssert.assertStringDoesNotContain(
        mail.getFlags(), "u", "Verify the mail flags does not contain (u)nread");
  }
  @Bugs(ids = "79188")
  @Test(
      description = "Delete a conversation - 1 message in inbox, 1 message in draft",
      groups = {"functional"})
  public void DeleteConversation_11() throws HarnessException {

    // -- DATA
    String subject = "subject" + ZimbraSeleniumProperties.getUniqueString();

    // Create a conversation (1 message in inbox, 1 draft response)
    ZimbraAccount.AccountA()
        .soapSend(
            "<SendMsgRequest xmlns='urn:zimbraMail'>"
                + "<m>"
                + "<e t='t' a='"
                + app.zGetActiveAccount().EmailAddress
                + "'/>"
                + "<su>"
                + subject
                + "</su>"
                + "<mp ct='text/plain'>"
                + "<content>body "
                + ZimbraSeleniumProperties.getUniqueString()
                + "</content>"
                + "</mp>"
                + "</m>"
                + "</SendMsgRequest>");

    MailItem message1 =
        MailItem.importFromSOAP(app.zGetActiveAccount(), "subject:(" + subject + ")");

    app.zGetActiveAccount()
        .soapSend(
            "<SaveDraftRequest xmlns='urn:zimbraMail'>"
                + "<m origid='"
                + message1.getId()
                + "' rt='r'>"
                + "<e t='t' a='"
                + ZimbraAccount.AccountA().EmailAddress
                + "'/>"
                + "<su>RE: "
                + subject
                + "</su>"
                + "<mp ct='text/plain'>"
                + "<content>body "
                + ZimbraSeleniumProperties.getUniqueString()
                + "</content>"
                + "</mp>"
                + "</m>"
                + "</SaveDraftRequest>");

    // Get the system folders
    FolderItem inbox = FolderItem.importFromSOAP(app.zGetActiveAccount(), SystemFolder.Inbox);
    FolderItem drafts = FolderItem.importFromSOAP(app.zGetActiveAccount(), SystemFolder.Drafts);
    FolderItem trash = FolderItem.importFromSOAP(app.zGetActiveAccount(), SystemFolder.Trash);

    // -- GUI

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

    // Click in Drafts
    app.zTreeMail.zTreeItem(Action.A_LEFTCLICK, drafts);

    // Select the conversation or message (in 8.X, only messages are shown in drafts, not
    // conversations)
    app.zPageMail.zListItem(Action.A_LEFTCLICK, subject);

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

    // -- Verification

    // Verify inbox message remains (bug 79188)
    MailItem m =
        MailItem.importFromSOAP(
            app.zGetActiveAccount(), "subject:(" + subject + ") inid:" + inbox.getId());
    ZAssert.assertNotNull(m, "Verify original message reamins in the inbox");

    // Verify draft is no longer in drafts folder
    m =
        MailItem.importFromSOAP(
            app.zGetActiveAccount(), "subject:(" + subject + ") inid:" + drafts.getId());
    ZAssert.assertNull(m, "Verify message is deleted from drafts");

    // Verify draft is in trash folder
    m =
        MailItem.importFromSOAP(
            app.zGetActiveAccount(), "subject:(" + subject + ") inid:" + trash.getId());
    ZAssert.assertNotNull(m, "Verify message is moved to trash");
  }
  @Test(
      description =
          "Delete a conversation - 1 message in inbox, 1 message in sent, 1 message in subfolder",
      groups = {"functional"})
  public void DeleteConversation_10() throws HarnessException {

    // -- DATA

    // Create a conversation (3 messages)
    ConversationItem c = ConversationItem.createConversationItem(app.zGetActiveAccount());

    // Put one message in inbox, one in trash, one in subfolder

    // Get the system folders
    FolderItem inbox = FolderItem.importFromSOAP(app.zGetActiveAccount(), SystemFolder.Inbox);
    FolderItem trash = FolderItem.importFromSOAP(app.zGetActiveAccount(), SystemFolder.Trash);
    FolderItem sent = FolderItem.importFromSOAP(app.zGetActiveAccount(), SystemFolder.Sent);

    // Move the conversation to the trash
    app.zGetActiveAccount()
        .soapSend(
            "<ItemActionRequest xmlns='urn:zimbraMail'>"
                + "<action op='move' l='"
                + trash.getId()
                + "' id='"
                + c.getMessageList().get(0).getId()
                + "'/>"
                + "</ItemActionRequest>");

    // Create a message in a subfolder
    String foldername = "folder" + ZimbraSeleniumProperties.getUniqueString();
    app.zGetActiveAccount()
        .soapSend(
            "<CreateFolderRequest xmlns='urn:zimbraMail'>"
                + "<folder name='"
                + foldername
                + "' l='"
                + inbox.getId()
                + "'/>"
                + "</CreateFolderRequest>");
    FolderItem subfolder = FolderItem.importFromSOAP(app.zGetActiveAccount(), foldername);

    // Move the conversation to the subfolder
    app.zGetActiveAccount()
        .soapSend(
            "<ItemActionRequest xmlns='urn:zimbraMail'>"
                + "<action op='move' l='"
                + subfolder.getId()
                + "' id='"
                + c.getMessageList().get(1).getId()
                + "'/>"
                + "</ItemActionRequest>");

    // Reply to one message (putting a message in sent)
    app.zGetActiveAccount()
        .soapSend(
            "<SendMsgRequest xmlns='urn:zimbraMail'>"
                + "<m origid='"
                + c.getMessageList().get(2).getId()
                + "' rt='r'>"
                + "<e t='t' a='"
                + ZimbraAccount.AccountA().EmailAddress
                + "'/>"
                + "<su>RE: "
                + c.getSubject()
                + "</su>"
                + "<mp ct='text/plain'>"
                + "<content>"
                + "body"
                + ZimbraSeleniumProperties.getUniqueString()
                + "</content>"
                + "</mp>"
                + "</m>"
                + "</SendMsgRequest>");
    String idSent = app.zGetActiveAccount().soapSelectValue("//mail:m", "id");

    // -- GUI

    // 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

    // Expected: all messages should be in trash, except for the sent message
    // Check each message to verify they exist in the trash
    ConversationItem actual =
        ConversationItem.importFromSOAP(
            app.zGetActiveAccount(), "is:anywhere subject:" + c.getSubject());

    for (MailItem m : actual.getMessageList()) {
      if (idSent.equals(m.getId())) {
        // Sent message should remain in sent
        ZAssert.assertEquals(
            m.dFolderId, sent.getId(), "Verify the conversation message is in the sent folder");
      } else {
        // All other messages should be moved to trash
        ZAssert.assertEquals(
            m.dFolderId, trash.getId(), "Verify the conversation message is in the trash");
      }
    }
  }
Ejemplo n.º 27
0
  @Test(
      description =
          "Verify that if the message is not read for less than zimbraPrefMarkMsgRead, it is not read",
      groups = {"functional"})
  public void MarkReadMail_02() throws HarnessException {

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

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

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

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

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

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

    // Select the next item immediately
    app.zPageMail.zListItem(Action.A_LEFTCLICK, mail2.dSubject);

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

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

  }
Ejemplo n.º 28
0
  @Bugs(ids = "69132")
  @Test(
      description = "Cancel meeting using context menu",
      groups = {"functional"})
  public void CancelMeeting_01() throws HarnessException {

    // -- Data setup

    // Creating object for meeting data
    String tz, apptSubject, apptBody, apptAttendee1;
    tz = ZTimeZone.TimeZoneEST.getID();
    apptSubject = ZimbraSeleniumProperties.getUniqueString();
    apptBody = ZimbraSeleniumProperties.getUniqueString();
    apptAttendee1 = ZimbraAccount.AccountA().EmailAddress;

    // Absolute dates in UTC zone
    Calendar now = this.calendarWeekDayUTC;
    ZDate startUTC =
        new ZDate(
            now.get(Calendar.YEAR),
            now.get(Calendar.MONTH) + 1,
            now.get(Calendar.DAY_OF_MONTH),
            12,
            0,
            0);
    ZDate endUTC =
        new ZDate(
            now.get(Calendar.YEAR),
            now.get(Calendar.MONTH) + 1,
            now.get(Calendar.DAY_OF_MONTH),
            14,
            0,
            0);

    app.zGetActiveAccount()
        .soapSend(
            "<CreateAppointmentRequest xmlns='urn:zimbraMail'>"
                + "<m>"
                + "<inv method='REQUEST' type='event' status='CONF' draft='0' class='PUB' fb='B' transp='O' allDay='0' name='"
                + apptSubject
                + "'>"
                + "<s d='"
                + startUTC.toTimeZone(tz).toYYYYMMDDTHHMMSS()
                + "' tz='"
                + tz
                + "'/>"
                + "<e d='"
                + endUTC.toTimeZone(tz).toYYYYMMDDTHHMMSS()
                + "' tz='"
                + tz
                + "'/>"
                + "<or a='"
                + app.zGetActiveAccount().EmailAddress
                + "'/>"
                + "<at role='REQ' ptst='NE' rsvp='1' a='"
                + apptAttendee1
                + "' d='2'/>"
                + "</inv>"
                + "<e a='"
                + apptAttendee1
                + "' t='t'/>"
                + "<mp content-type='text/plain'>"
                + "<content>"
                + apptBody
                + "</content>"
                + "</mp>"
                + "<su>"
                + apptSubject
                + "</su>"
                + "</m>"
                + "</CreateAppointmentRequest>");
    String apptId =
        app.zGetActiveAccount().soapSelectValue("//mail:CreateAppointmentResponse", "apptId");

    // -- GUI actions

    // Refresh the view
    app.zPageCalendar.zToolbarPressButton(Button.B_REFRESH);

    // Select the appointment
    app.zPageCalendar.zListItem(Action.A_LEFTCLICK, apptSubject);

    // Right Click -> Delete context menu
    DialogWarning dialog =
        (DialogWarning)
            app.zPageCalendar.zListItem(Action.A_RIGHTCLICK, Button.O_CANCEL_MENU, apptSubject);

    // Click Send Cancellation
    dialog.zClickButton(Button.B_SEND_CANCELLATION);

    // -- Verification

    // Verify the meeting disappears from the view
    ZAssert.assertEquals(
        app.zPageCalendar.sIsElementPresent(app.zPageCalendar.zGetApptLocator(apptSubject)),
        false,
        "Verify meeting is deleted from organizer's calendar");

    // Verify meeting is deleted from attendee's calendar
    //		AppointmentItem canceledAppt = AppointmentItem.importFromSOAP(ZimbraAccount.AccountA(),
    // "subject:("+ apptSubject +")", startUTC, endUTC);
    AppointmentItem canceledAppt =
        AppointmentItem.importFromSOAP(ZimbraAccount.AccountA(), "subject:(" + apptSubject + ")");
    ZAssert.assertNull(canceledAppt, "Verify meeting is deleted from attendee's calendar");
  }
Ejemplo n.º 29
0
  @Bugs(ids = "69132")
  @Test(
      description = "Delete an appointment using keyboard shortcuts (Del & Backspace)",
      groups = {"functional"},
      dataProvider = "DataProviderShortcutKeys")
  public void DeleteAppointment_03(String name, int keyEvent) throws HarnessException {

    // Creating objects for appointment data
    String tz, apptSubject, apptBody;
    tz = ZTimeZone.TimeZoneEST.getID();
    apptSubject = ZimbraSeleniumProperties.getUniqueString();
    apptBody = ZimbraSeleniumProperties.getUniqueString();

    // Absolute dates in UTC zone
    Calendar now = this.calendarWeekDayUTC;
    ZDate startUTC =
        new ZDate(
            now.get(Calendar.YEAR),
            now.get(Calendar.MONTH) + 1,
            now.get(Calendar.DAY_OF_MONTH),
            12,
            0,
            0);
    ZDate endUTC =
        new ZDate(
            now.get(Calendar.YEAR),
            now.get(Calendar.MONTH) + 1,
            now.get(Calendar.DAY_OF_MONTH),
            14,
            0,
            0);

    app.zGetActiveAccount()
        .soapSend(
            "<CreateAppointmentRequest xmlns='urn:zimbraMail'>"
                + "<m>"
                + "<inv method='REQUEST' type='event' fb='B' transp='O' allDay='0' name='"
                + apptSubject
                + "'>"
                + "<s d='"
                + startUTC.toTimeZone(tz).toYYYYMMDDTHHMMSS()
                + "' tz='"
                + tz
                + "'/>"
                + "<e d='"
                + endUTC.toTimeZone(tz).toYYYYMMDDTHHMMSS()
                + "' tz='"
                + tz
                + "'/>"
                + "<or a='"
                + app.zGetActiveAccount().EmailAddress
                + "'/>"
                + "</inv>"
                + "<mp content-type='text/plain'>"
                + "<content>"
                + apptBody
                + "</content>"
                + "</mp>"
                + "<su>"
                + apptSubject
                + "</su>"
                + "</m>"
                + "</CreateAppointmentRequest>");
    String apptId =
        app.zGetActiveAccount()
            .soapSelectValue("//mail:CreateAppointmentResponse//mail:appt", "id");

    // Delete appointment using keyboard Del and Backspace key
    app.zPageCalendar.zToolbarPressButton(Button.B_REFRESH);
    app.zPageCalendar.zListItem(Action.A_LEFTCLICK, apptSubject);
    DialogConfirmDeleteAppointment dlgConfirm =
        (DialogConfirmDeleteAppointment) app.zPageCalendar.zKeyboardKeyEvent(keyEvent);
    dlgConfirm.zClickButton(Button.B_YES);

    // -- Verification
    app.zGetActiveAccount()
        .soapSend(
            "<SearchRequest xmlns='urn:zimbraMail' types='appointment' calExpandInstStart='"
                + startUTC.addDays(-7).toMillis()
                + "' calExpandInstEnd='"
                + startUTC.addDays(7).toMillis()
                + "'>"
                + "<query>subject:("
                + apptSubject
                + ")</query>"
                + "</SearchRequest>");

    Element[] nodes = app.zGetActiveAccount().soapSelectNodes("//mail:appt");
    ZAssert.assertEquals(nodes.length, 0, "Verify appointment is deleted");
  }
Ejemplo n.º 30
0
  @Bugs(ids = "69132")
  @Test(
      description = "Delete an appointment using Delete toolbar button",
      groups = {"smoke"})
  public void DeleteAppointment_01() throws HarnessException {

    // Creating objects for appointment data
    String tz, apptSubject, apptBody;
    tz = ZTimeZone.TimeZoneEST.getID();
    apptSubject = ZimbraSeleniumProperties.getUniqueString();
    apptBody = ZimbraSeleniumProperties.getUniqueString();

    // Absolute dates in UTC zone
    Calendar now = this.calendarWeekDayUTC;
    ZDate startUTC =
        new ZDate(
            now.get(Calendar.YEAR),
            now.get(Calendar.MONTH) + 1,
            now.get(Calendar.DAY_OF_MONTH),
            12,
            0,
            0);
    ZDate endUTC =
        new ZDate(
            now.get(Calendar.YEAR),
            now.get(Calendar.MONTH) + 1,
            now.get(Calendar.DAY_OF_MONTH),
            14,
            0,
            0);

    app.zGetActiveAccount()
        .soapSend(
            "<CreateAppointmentRequest xmlns='urn:zimbraMail'>"
                + "<m>"
                + "<inv method='REQUEST' type='event' fb='B' transp='O' allDay='0' name='"
                + apptSubject
                + "'>"
                + "<s d='"
                + startUTC.toTimeZone(tz).toYYYYMMDDTHHMMSS()
                + "' tz='"
                + tz
                + "'/>"
                + "<e d='"
                + endUTC.toTimeZone(tz).toYYYYMMDDTHHMMSS()
                + "' tz='"
                + tz
                + "'/>"
                + "<or a='"
                + app.zGetActiveAccount().EmailAddress
                + "'/>"
                + "</inv>"
                + "<mp content-type='text/plain'>"
                + "<content>"
                + apptBody
                + "</content>"
                + "</mp>"
                + "<su>"
                + apptSubject
                + "</su>"
                + "</m>"
                + "</CreateAppointmentRequest>");

    // Right click to appointment and delete it
    app.zPageCalendar.zToolbarPressButton(Button.B_REFRESH);
    app.zPageCalendar.zListItem(Action.A_LEFTCLICK, apptSubject);
    DialogConfirmDeleteAppointment dlgConfirm =
        (DialogConfirmDeleteAppointment) app.zPageCalendar.zToolbarPressButton(Button.B_DELETE);
    dlgConfirm.zClickButton(Button.B_YES);
    dlgConfirm.zWaitForClose();

    ZAssert.assertEquals(
        app.zPageCalendar.zIsAppointmentExists(apptSubject),
        false,
        "Verify appointment is deleted");
  }