@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");
  }
示例#2
0
  @Bugs(ids = "81920")
  @Test(
      description = "Reply to a conversation with a draft",
      groups = {"functional"})
  public void Bug81920_01() throws HarnessException {

    // -- DATA

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

    // Create a draft in the conversation
    // First, need to determine the last message received
    int id = 0;
    for (MailItem m : c.getMessageList()) {
      if (Integer.parseInt(m.getId()) > id) {
        id = Integer.parseInt(m.getId());
      }
    }
    String body = "draft" + ZimbraSeleniumProperties.getUniqueString();
    app.zGetActiveAccount()
        .soapSend(
            "<SaveDraftRequest xmlns='urn:zimbraMail'>"
                + "<m origid='"
                + id
                + "' rt='r'>"
                + "<e t='t' a='"
                + ZimbraAccount.AccountA().EmailAddress
                + "'/>"
                + "<su>RE: "
                + c.getSubject()
                + "</su>"
                + "<mp ct='text/plain'>"
                + "<content>"
                + body
                + "</content>"
                + "</mp>"
                + "</m>"
                + "</SaveDraftRequest>");

    // Change the whole conversation to be unread
    app.zGetActiveAccount()
        .soapSend(
            "<ItemActionRequest xmlns='urn:zimbraMail'>"
                + "<action op='!read' id='"
                + c.getId()
                + "'/>"
                + "</ItemActionRequest>");

    // -- GUI

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

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

    // Click reply
    FormMailNew mailform = (FormMailNew) app.zPageMail.zToolbarPressButton(Button.B_REPLY);
    ZAssert.assertNotNull(mailform, "Verify the new form opened");

    // Send the message
    mailform.zSubmit();

    // -- Verification

    // From the test account, check the sent folder for the reply
    MailItem sent =
        MailItem.importFromSOAP(
            app.zGetActiveAccount(), "in:sent subject:(" + c.getSubject() + ")");
    ZAssert.assertNotNull(sent, "Verify the sent message in the sent folder");

    // Verify the draft body does not appear in the reply
    ZAssert.assertStringDoesNotContain(
        sent.dBodyText, body, "Verify the draft body does not appear in the reply");
  }
  @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");
      }
    }
  }
示例#4
0
  @Bugs(ids = "81920")
  @Test(
      description = "Reply to a conversation with a spammed message",
      groups = {"functional"})
  public void Bug81920_03() throws HarnessException {

    // -- DATA

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

    // Create a draft in the conversation
    // First, need to determine the last message received
    int id = 0;
    String body = null;
    for (MailItem m : c.getMessageList()) {
      if (Integer.parseInt(m.getId()) > id) {
        id = Integer.parseInt(m.getId());
        body = m.dBodyText;
      }
    }

    // Move the last message to the trash
    app.zGetActiveAccount()
        .soapSend(
            "<ItemActionRequest xmlns='urn:zimbraMail'>"
                + "<action op='spam' id='"
                + id
                + "'/>"
                + "</ItemActionRequest>");

    // Change the whole conversation to be unread
    app.zGetActiveAccount()
        .soapSend(
            "<ItemActionRequest xmlns='urn:zimbraMail'>"
                + "<action op='!read' id='"
                + c.getId()
                + "'/>"
                + "</ItemActionRequest>");

    // -- GUI

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

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

    // Click reply
    FormMailNew mailform = (FormMailNew) app.zPageMail.zToolbarPressButton(Button.B_REPLY);
    ZAssert.assertNotNull(mailform, "Verify the new form opened");

    // Send the message
    mailform.zSubmit();

    // -- Verification

    // From the test account, check the sent folder for the reply
    MailItem sent =
        MailItem.importFromSOAP(
            app.zGetActiveAccount(), "in:sent subject:(" + c.getSubject() + ")");
    ZAssert.assertNotNull(sent, "Verify the sent message in the sent folder");

    // Verify the draft body does not appear in the reply
    ZAssert.assertStringDoesNotContain(
        sent.dBodyText, body, "Verify the spam body does not appear in the reply");
  }