@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");
  }
Exemplo n.º 2
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");
  }
Exemplo n.º 3
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");
  }