@BeforeMethod(
     description = "Make sure the Owner account exists",
     groups = {"always"})
 public void CreateOwner() throws HarnessException {
   Owner = new ZimbraAccount();
   Owner.provision();
   Owner.authenticate();
 }
Beispiel #2
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");
  }
  /**
   * ZimbraAccount.AccountA() sends a two-hour appointment to app.zGetActiveAccount() with subject
   * and start time
   *
   * @param subject
   * @param start
   * @throws HarnessException
   */
  private void SendCreateAppointmentRequest(String subject, ZDate start) throws HarnessException {

    ZimbraAccount.AccountA()
        .soapSend(
            "<CreateAppointmentRequest xmlns='urn:zimbraMail'>"
                + "<m>"
                + "<inv method='REQUEST' type='event' status='CONF' draft='0' class='PUB' fb='B' transp='O' allDay='0' name='"
                + subject
                + "'>"
                + "<s d='"
                + start.toTimeZone(ZTimeZone.TimeZoneEST.getID()).toYYYYMMDDTHHMMSS()
                + "' tz='"
                + ZTimeZone.TimeZoneEST.getID()
                + "'/>"
                + "<e d='"
                + start.addHours(2).toTimeZone(ZTimeZone.TimeZoneEST.getID()).toYYYYMMDDTHHMMSS()
                + "' tz='"
                + ZTimeZone.TimeZoneEST.getID()
                + "'/>"
                + "<or a='"
                + ZimbraAccount.AccountA().EmailAddress
                + "'/>"
                + "<at role='REQ' ptst='NE' rsvp='1' a='"
                + app.zGetActiveAccount().EmailAddress
                + "'/>"
                + "</inv>"
                + "<e a='"
                + app.zGetActiveAccount().EmailAddress
                + "' t='t'/>"
                + "<su>"
                + subject
                + "</su>"
                + "<mp content-type='text/plain'>"
                + "<content>content</content>"
                + "</mp>"
                + "</m>"
                + "</CreateAppointmentRequest>");
  }
  @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

  }
  @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

  }
  @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");
  }
Beispiel #7
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");
  }
Beispiel #8
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");
  }
  @Bugs(ids = "69132")
  @Test(
      description = "Accept meeting - Verify organizer gets notification message",
      groups = {"functional"})
  public void AcceptMeeting_02() throws HarnessException {

    // ------------------------ Test data ------------------------------------

    String apptSubject = "appointment" + ZimbraSeleniumProperties.getUniqueString();
    Calendar now = Calendar.getInstance();
    ZDate startUTC =
        new ZDate(
            now.get(Calendar.YEAR),
            now.get(Calendar.MONTH) + 1,
            now.get(Calendar.DAY_OF_MONTH),
            12,
            0,
            0);

    // --------------- Creating invitation (organizer) ----------------------------

    this.SendCreateAppointmentRequest(apptSubject, startUTC);

    // --------------- Login to attendee & accept invitation
    // ----------------------------------------------------

    app.zPageMail.zToolbarPressButton(Button.B_GETMAIL);

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

    // Click Accept
    display.zPressButton(Button.B_ACCEPT);

    // ---------------- Verification at organizer & invitee side both
    // -------------------------------------

    // --- Check that the organizer shows the attendee as "ACCEPT" ---

    // Organizer: Search for the appointment response
    String inboxId =
        FolderItem.importFromSOAP(ZimbraAccount.AccountA(), FolderItem.SystemFolder.Inbox).getId();

    ZimbraAccount.AccountA()
        .soapSend(
            "<SearchRequest xmlns='urn:zimbraMail' types='message'>"
                + "<query>inid:"
                + inboxId
                + " subject:("
                + apptSubject
                + ")</query>"
                + "</SearchRequest>");

    String messageId = ZimbraAccount.AccountA().soapSelectValue("//mail:m", "id");

    // Get the appointment details
    ZimbraAccount.AccountA()
        .soapSend(
            "<GetMsgRequest  xmlns='urn:zimbraMail'>"
                + "<m id='"
                + messageId
                + "'/>"
                + "</GetMsgRequest>");
  }
  @Test(
      description = "Grantee views show original of the appointment from grantor's calendar",
      groups = {"functional"})
  public void ShowOriginal_01() throws HarnessException {

    String apptSubject = "appointment" + ZimbraSeleniumProperties.getUniqueString();
    String apptContent = ZimbraSeleniumProperties.getUniqueString();
    String foldername = "folder" + ZimbraSeleniumProperties.getUniqueString();
    String mountpointname = "mountpoint" + ZimbraSeleniumProperties.getUniqueString();

    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);

    FolderItem calendarFolder =
        FolderItem.importFromSOAP(ZimbraAccount.AccountA(), FolderItem.SystemFolder.Calendar);

    // Create a folder to share
    ZimbraAccount.AccountA()
        .soapSend(
            "<CreateFolderRequest xmlns='urn:zimbraMail'>"
                + "<folder name='"
                + foldername
                + "' l='"
                + calendarFolder.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' view='appointment'/>"
                + "</action>"
                + "</FolderActionRequest>");

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

    // Create appointment
    ZimbraAccount.AccountA()
        .soapSend(
            "<CreateAppointmentRequest xmlns='urn:zimbraMail'>"
                + "<m l='"
                + folder.getId()
                + "' >"
                + "<inv method='REQUEST' type='event' status='CONF' draft='0' class='PUB' fb='B' transp='O' allDay='0' name='"
                + apptSubject
                + "'>"
                + "<s d='"
                + startUTC.toTimeZone(ZTimeZone.TimeZoneEST.getID()).toYYYYMMDDTHHMMSS()
                + "' tz='"
                + ZTimeZone.TimeZoneEST.getID()
                + "'/>"
                + "<e d='"
                + endUTC.toTimeZone(ZTimeZone.TimeZoneEST.getID()).toYYYYMMDDTHHMMSS()
                + "' tz='"
                + ZTimeZone.TimeZoneEST.getID()
                + "'/>"
                + "<or a='"
                + ZimbraAccount.AccountA().EmailAddress
                + "'/>"
                + "<at role='REQ' ptst='NE' rsvp='1' a='"
                + app.zGetActiveAccount().EmailAddress
                + "'/>"
                + "</inv>"
                + "<e a='"
                + app.zGetActiveAccount().EmailAddress
                + "' t='t'/>"
                + "<su>"
                + apptSubject
                + "</su>"
                + "<mp content-type='text/plain'>"
                + "<content>"
                + apptContent
                + "</content>"
                + "</mp>"
                + "</m>"
                + "</CreateAppointmentRequest>");
    app.zPageCalendar.zToolbarPressButton(Button.B_REFRESH);

    // Mark ON to mounted calendar folder and select the appointment
    app.zTreeCalendar.zDeSelectCalendarFolder("Calendar");
    app.zTreeCalendar.zSelectMountedFolder(mountpointname);

    // Appointment show original
    SeparateWindowShowOriginal window =
        (SeparateWindowShowOriginal)
            app.zPageCalendar.zListItem(
                Action.A_RIGHTCLICK, Button.O_SHOW_ORIGINAL_MENU, apptSubject);
    try {
      window.zWaitForActive();
      SleepUtil.sleepMedium();
      ZAssert.assertTrue(window.zIsActive(), "Verify the window is active");

      String body = window.sGetBodyText();
      ZAssert.assertStringContains(body, apptSubject, "Verify subject in show original");
      ZAssert.assertStringContains(body, apptContent, "Verify content in show original");
      ZAssert.assertStringContains(body, "BEGIN:VCALENDAR", "Verify BEGIN header in show original");
      ZAssert.assertStringContains(body, "END:VCALENDAR", "Verify END header in show original");
      ZAssert.assertStringContains(
          body,
          "ORGANIZER:mailto:" + ZimbraAccount.AccountA().EmailAddress,
          "Verify organizer value in show original");

    } finally {
      if (window != null) window.zCloseWindow();
    }
  }
  @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 = "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");
  }
Beispiel #13
0
  @Test(
      description =
          "Grantee opens appointment from grantor's calendar and close it without making any changes",
      groups = {"functional"})
  public void Close_01() throws HarnessException {

    String apptSubject = "appointment" + ZimbraSeleniumProperties.getUniqueString();
    String apptContent = ZimbraSeleniumProperties.getUniqueString();
    String foldername = "folder" + ZimbraSeleniumProperties.getUniqueString();
    String mountpointname = "mountpoint" + ZimbraSeleniumProperties.getUniqueString();

    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);

    FolderItem calendarFolder =
        FolderItem.importFromSOAP(ZimbraAccount.AccountA(), FolderItem.SystemFolder.Calendar);

    // Create a folder to share
    ZimbraAccount.AccountA()
        .soapSend(
            "<CreateFolderRequest xmlns='urn:zimbraMail'>"
                + "<folder name='"
                + foldername
                + "' l='"
                + calendarFolder.getId()
                + "' view='appointment'/>"
                + "</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' view='appointment'/>"
                + "</action>"
                + "</FolderActionRequest>");

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

    // Create appointment
    ZimbraAccount.AccountA()
        .soapSend(
            "<CreateAppointmentRequest xmlns='urn:zimbraMail'>"
                + "<m l='"
                + folder.getId()
                + "' >"
                + "<inv method='REQUEST' type='event' status='CONF' draft='0' class='PUB' fb='B' transp='O' allDay='0' name='"
                + apptSubject
                + "'>"
                + "<s d='"
                + startUTC.toTimeZone(ZTimeZone.TimeZoneEST.getID()).toYYYYMMDDTHHMMSS()
                + "' tz='"
                + ZTimeZone.TimeZoneEST.getID()
                + "'/>"
                + "<e d='"
                + endUTC.toTimeZone(ZTimeZone.TimeZoneEST.getID()).toYYYYMMDDTHHMMSS()
                + "' tz='"
                + ZTimeZone.TimeZoneEST.getID()
                + "'/>"
                + "<or a='"
                + ZimbraAccount.AccountA().EmailAddress
                + "'/>"
                + "<at role='REQ' ptst='NE' rsvp='1' a='"
                + app.zGetActiveAccount().EmailAddress
                + "'/>"
                + "</inv>"
                + "<e a='"
                + app.zGetActiveAccount().EmailAddress
                + "' t='t'/>"
                + "<su>"
                + apptSubject
                + "</su>"
                + "<mp content-type='text/plain'>"
                + "<content>"
                + apptContent
                + "</content>"
                + "</mp>"
                + "</m>"
                + "</CreateAppointmentRequest>");
    app.zPageCalendar.zToolbarPressButton(Button.B_REFRESH);

    // Mark ON to mounted calendar folder and select the appointment
    app.zTreeCalendar.zMarkOnOffCalendarFolder("Calendar");
    app.zTreeCalendar.zMarkOnOffMountedFolder(mountpointname);

    // Open appointment
    app.zPageCalendar.zListItem(Action.A_RIGHTCLICK, Button.O_OPEN_MENU, apptSubject);
    app.zPageCalendar.zToolbarPressButton(Button.B_CLOSE);

    // Make sure there is no warning or any other dialog (below code should fail if any)
    app.zPageCalendar.zListItem(Action.A_RIGHTCLICK, Button.O_OPEN_MENU, apptSubject);
    app.zPageCalendar.zToolbarPressButton(Button.B_CLOSE);
  }
  @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");
      }
    }
  }
  @Bugs(ids = "69132")
  @Test(
      description = "Accept meeting using 'Accept -> Edit Reply' and verify modified content",
      groups = {"functional"})
  public void AcceptMeeting_04() throws HarnessException {

    // ------------------------ Test data ------------------------------------

    String apptSubject = "appointment" + ZimbraSeleniumProperties.getUniqueString();
    String modifiedBody = "modified" + ZimbraSeleniumProperties.getUniqueString();

    Calendar now = Calendar.getInstance();
    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);

    // --------------- Creating invitation (organizer) ----------------------------

    ZimbraAccount.AccountA()
        .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(ZTimeZone.TimeZoneEST.getID()).toYYYYMMDDTHHMMSS()
                + "' tz='"
                + ZTimeZone.TimeZoneEST.getID()
                + "'/>"
                + "<e d='"
                + endUTC.toTimeZone(ZTimeZone.TimeZoneEST.getID()).toYYYYMMDDTHHMMSS()
                + "' tz='"
                + ZTimeZone.TimeZoneEST.getID()
                + "'/>"
                + "<or a='"
                + ZimbraAccount.AccountA().EmailAddress
                + "'/>"
                + "<at role='REQ' ptst='NE' rsvp='1' a='"
                + app.zGetActiveAccount().EmailAddress
                + "'/>"
                + "</inv>"
                + "<e a='"
                + app.zGetActiveAccount().EmailAddress
                + "' t='t'/>"
                + "<su>"
                + apptSubject
                + "</su>"
                + "<mp content-type='text/plain'>"
                + "<content>content</content>"
                + "</mp>"
                + "</m>"
                + "</CreateAppointmentRequest>");

    // --------------- Login to attendee & accept invitation
    // ----------------------------------------------------

    // Refresh the view
    app.zPageMail.zToolbarPressButton(Button.B_GETMAIL);

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

    // Click Accept -> Edit Reply , which will open a new reply compose
    FormMailNew editReply =
        (FormMailNew) display.zPressButtonPulldown(Button.B_ACCEPT, Button.O_ACCEPT_EDIT_REPLY);
    editReply.zFillField(Field.Body, modifiedBody);
    editReply.zSubmit();

    // ---------------- Verification at organizer & invitee side both
    // -------------------------------------

    // --- Check that the organizer shows the attendee as "ACCEPT" ---

    // Organizer: Search for the appointment (InvId)
    ZimbraAccount.AccountA()
        .soapSend(
            "<SearchRequest xmlns='urn:zimbraMail' types='appointment' calExpandInstStart='"
                + startUTC.addDays(-10).toMillis()
                + "' calExpandInstEnd='"
                + endUTC.addDays(10).toMillis()
                + "'>"
                + "<query>"
                + apptSubject
                + "</query>"
                + "</SearchRequest>");

    String organizerInvId = ZimbraAccount.AccountA().soapSelectValue("//mail:appt", "invId");

    // Get the appointment details
    ZimbraAccount.AccountA()
        .soapSend("<GetAppointmentRequest  xmlns='urn:zimbraMail' id='" + organizerInvId + "'/>");

    String attendeeStatus =
        ZimbraAccount.AccountA()
            .soapSelectValue(
                "//mail:at[@a='" + app.zGetActiveAccount().EmailAddress + "']", "ptst");

    // Verify attendee status shows as psts=AC
    ZAssert.assertEquals(attendeeStatus, "AC", "Verify that the attendee shows as 'ACCEPTED'");

    // --- Check that the attendee showing status as "ACCEPT" ---

    // Attendee: Search for the appointment (InvId)
    app.zGetActiveAccount()
        .soapSend(
            "<SearchRequest xmlns='urn:zimbraMail' types='appointment' calExpandInstStart='"
                + startUTC.addDays(-10).toMillis()
                + "' calExpandInstEnd='"
                + endUTC.addDays(10).toMillis()
                + "'>"
                + "<query>"
                + apptSubject
                + "</query>"
                + "</SearchRequest>");

    String attendeeInvId = app.zGetActiveAccount().soapSelectValue("//mail:appt", "invId");

    // Get the appointment details
    app.zGetActiveAccount()
        .soapSend("<GetAppointmentRequest  xmlns='urn:zimbraMail' id='" + attendeeInvId + "'/>");

    String myStatus =
        app.zGetActiveAccount()
            .soapSelectValue(
                "//mail:at[@a='" + app.zGetActiveAccount().EmailAddress + "']", "ptst");

    // Verify attendee status shows as psts=AC
    ZAssert.assertEquals(myStatus, "AC", "Verify that the attendee shows as 'ACCEPTED'");

    // Organizer: Search for the appointment response
    String inboxId =
        FolderItem.importFromSOAP(ZimbraAccount.AccountA(), FolderItem.SystemFolder.Inbox).getId();

    ZimbraAccount.AccountA()
        .soapSend(
            "<SearchRequest xmlns='urn:zimbraMail' types='message'>"
                + "<query>inid:"
                + inboxId
                + " subject:("
                + apptSubject
                + ")</query>"
                + "</SearchRequest>");

    // Verify message body content
    String body = ZimbraAccount.AccountA().soapSelectValue("//mail:m/mail:fr", null);
    ZAssert.assertStringContains(body, modifiedBody, "Verify modified body value");
  }
  @Bugs(ids = "69132")
  @Test(
      description = "Accept a meeting using Accept button from invitation message",
      groups = {"smoke"})
  public void AcceptMeeting_01() throws HarnessException {

    // ------------------------ Test data ------------------------------------

    String apptSubject = "appointment" + ZimbraSeleniumProperties.getUniqueString();

    Calendar now = Calendar.getInstance();
    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);

    // --------------- Creating invitation (organizer) ----------------------------

    ZimbraAccount.AccountA()
        .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(ZTimeZone.TimeZoneEST.getID()).toYYYYMMDDTHHMMSS()
                + "' tz='"
                + ZTimeZone.TimeZoneEST.getID()
                + "'/>"
                + "<e d='"
                + endUTC.toTimeZone(ZTimeZone.TimeZoneEST.getID()).toYYYYMMDDTHHMMSS()
                + "' tz='"
                + ZTimeZone.TimeZoneEST.getID()
                + "'/>"
                + "<or a='"
                + ZimbraAccount.AccountA().EmailAddress
                + "'/>"
                + "<at role='REQ' ptst='NE' rsvp='1' a='"
                + app.zGetActiveAccount().EmailAddress
                + "'/>"
                + "</inv>"
                + "<e a='"
                + app.zGetActiveAccount().EmailAddress
                + "' t='t'/>"
                + "<su>"
                + apptSubject
                + "</su>"
                + "<mp content-type='text/plain'>"
                + "<content>content</content>"
                + "</mp>"
                + "</m>"
                + "</CreateAppointmentRequest>");

    // --------------- Login to attendee & accept invitation
    // ----------------------------------------------------

    // Refresh the view
    app.zPageMail.zToolbarPressButton(Button.B_GETMAIL);

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

    // Click Accept
    display.zPressButton(Button.B_ACCEPT);

    // ---------------- Verification at organizer & invitee side both
    // -------------------------------------

    // --- Check that the organizer shows the attendee as "ACCEPT" ---

    // Organizer: Search for the appointment (InvId)
    ZimbraAccount.AccountA()
        .soapSend(
            "<SearchRequest xmlns='urn:zimbraMail' types='appointment' calExpandInstStart='"
                + startUTC.addDays(-10).toMillis()
                + "' calExpandInstEnd='"
                + endUTC.addDays(10).toMillis()
                + "'>"
                + "<query>"
                + apptSubject
                + "</query>"
                + "</SearchRequest>");

    String organizerInvId = ZimbraAccount.AccountA().soapSelectValue("//mail:appt", "invId");

    // Get the appointment details
    ZimbraAccount.AccountA()
        .soapSend("<GetAppointmentRequest  xmlns='urn:zimbraMail' id='" + organizerInvId + "'/>");

    String attendeeStatus =
        ZimbraAccount.AccountA()
            .soapSelectValue(
                "//mail:at[@a='" + app.zGetActiveAccount().EmailAddress + "']", "ptst");

    // Verify attendee status shows as psts=AC
    ZAssert.assertEquals(attendeeStatus, "AC", "Verify that the attendee shows as 'ACCEPTED'");

    // --- Check that the attendee showing status as "ACCEPT" ---

    // Attendee: Search for the appointment (InvId)
    app.zGetActiveAccount()
        .soapSend(
            "<SearchRequest xmlns='urn:zimbraMail' types='appointment' calExpandInstStart='"
                + startUTC.addDays(-10).toMillis()
                + "' calExpandInstEnd='"
                + endUTC.addDays(10).toMillis()
                + "'>"
                + "<query>"
                + apptSubject
                + "</query>"
                + "</SearchRequest>");

    String attendeeInvId = app.zGetActiveAccount().soapSelectValue("//mail:appt", "invId");

    // Get the appointment details
    app.zGetActiveAccount()
        .soapSend("<GetAppointmentRequest  xmlns='urn:zimbraMail' id='" + attendeeInvId + "'/>");

    String myStatus =
        app.zGetActiveAccount()
            .soapSelectValue(
                "//mail:at[@a='" + app.zGetActiveAccount().EmailAddress + "']", "ptst");

    // Verify attendee status shows as psts=AC
    ZAssert.assertEquals(myStatus, "AC", "Verify that the attendee shows as 'ACCEPTED'");
  }
Beispiel #17
0
  @Test(
      description = "Flag a mail by using shortcut 'mf'",
      groups = {"functional"})
  public void FlagMail_02() 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);

    // Flag the item
    app.zPageMail.zKeyboardShortcut(Shortcut.S_MAIL_MARKFLAG);

    // Get the item from the list
    List<MailItem> messages = app.zPageMail.zListGetMessages();
    ZAssert.assertNotNull(messages, "Verify the message list exists");

    MailItem listmail = null;
    for (MailItem m : messages) {
      logger.info("Subject: looking for " + mail.dSubject + " found: " + m.gSubject);
      if (mail.dSubject.equals(m.gSubject)) {
        listmail = m;
        break;
      }
    }

    GeneralUtility.syncDesktopToZcsWithSoap(app.zGetActiveAccount());

    // Make sure the GUI shows "flagged"
    ZAssert.assertNotNull(listmail, "Verify the message is in the list");
    ZAssert.assertTrue(listmail.gIsFlagged, "Verify the message is flagged in the list");

    // Make sure the server shows "flagged"
    mail = MailItem.importFromSOAP(app.zGetActiveAccount(), "subject:(" + subject + ")");
    ZAssert.assertStringContains(
        mail.getFlags(), "f", "Verify the message is flagged in the server");
  }
Beispiel #18
0
  @Bugs(ids = "86168")
  @Test(
      description = "Forward (on behalf of) to a message in a shared folder (admin rights)",
      groups = {"functional"})
  public void ForwardMail_01() throws HarnessException {

    // -- DATA

    // Create the folder owner
    ZimbraAccount owner = (new ZimbraAccount()).provision().authenticate();

    // Allow sending rights
    owner.soapSend(
        "<GrantRightsRequest xmlns='urn:zimbraAccount'>"
            + "<ace gt='usr' d='"
            + app.zGetActiveAccount().EmailAddress
            + "' right='sendOnBehalfOf'/>"
            + "</GrantRightsRequest>");

    String foldername = "folder" + ZimbraSeleniumProperties.getUniqueString();
    String subject = "subject" + ZimbraSeleniumProperties.getUniqueString();
    String mountpointname = "mountpoint" + ZimbraSeleniumProperties.getUniqueString();

    FolderItem inbox = FolderItem.importFromSOAP(owner, FolderItem.SystemFolder.Inbox);

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

    FolderItem folder = FolderItem.importFromSOAP(owner, foldername);

    // Share it
    owner.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
    owner.soapSend(
        "<AddMsgRequest xmlns='urn:zimbraMail'>"
            + "<m l='"
            + folder.getId()
            + "' >"
            + "<content>From: "
            + ZimbraAccount.AccountB().EmailAddress
            + "\n"
            + "To: "
            + owner.EmailAddress
            + "\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='"
                + owner.ZimbraId
                + "'/>"
                + "</CreateMountpointRequest>");

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

    // -- GUI

    // Login to load the rights
    app.zPageLogin.zNavigateTo();
    this.startingPage.zNavigateTo();

    try {

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

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

      // Reply the item
      FormMailNew mailform = (FormMailNew) app.zPageMail.zToolbarPressButton(Button.B_FORWARD);
      mailform.zFillField(FormMailNew.Field.To, ZimbraAccount.AccountA().EmailAddress);
      mailform.zFillField(Field.From, owner.EmailAddress);
      mailform.zSubmit();

    } finally {

      // Select the inbox
      app.zTreeMail.zTreeItem(
          Action.A_LEFTCLICK,
          FolderItem.importFromSOAP(app.zGetActiveAccount(), FolderItem.SystemFolder.Inbox));
    }

    // -- VERIFICATION

    // From the receiving end, verify the message details
    // Need 'in:inbox' to separate the message from the sent message
    MailItem sent =
        MailItem.importFromSOAP(app.zGetActiveAccount(), "in:sent subject:(" + subject + ")");

    ZAssert.assertEquals(
        sent.dToRecipients.size(), 1, "Verify the message is sent to 1 'to' recipient");
    ZAssert.assertEquals(
        sent.dToRecipients.get(0).dEmailAddress,
        ZimbraAccount.AccountA().EmailAddress,
        "Verify the 'To' field is correct");
    ZAssert.assertEquals(
        sent.dFromRecipient.dEmailAddress,
        owner.EmailAddress,
        "Verify the 'From' field is correct");
    ZAssert.assertEquals(
        sent.dSenderRecipient.dEmailAddress,
        app.zGetActiveAccount().EmailAddress,
        "Verify the 'Sender' field is correct");
  }
Beispiel #19
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

  }
Beispiel #20
0
  @Test(
      description = "Login to the Ajax Client - with a mountpoint to a deleted share",
      groups = {"functional"})
  public void ShareDeleted01() throws HarnessException {

    // Data setup

    String subject = "subject" + ZimbraSeleniumProperties.getUniqueString();
    String foldername = "folder" + ZimbraSeleniumProperties.getUniqueString();
    String mountpointname = "mountpoint" + ZimbraSeleniumProperties.getUniqueString();

    FolderItem inbox = FolderItem.importFromSOAP(Owner, FolderItem.SystemFolder.Inbox);

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

    FolderItem folder = FolderItem.importFromSOAP(Owner, foldername);

    Owner.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>");

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

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

    FolderMountpointItem mountpoint =
        FolderMountpointItem.importFromSOAP(app.zGetActiveAccount(), mountpointname);
    ZAssert.assertNotNull(mountpoint, "Verify the mountpoint was created");

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

    // View the folder
    app.zTreeMail.zTreeItem(Action.A_LEFTCLICK, mountpoint);

    // Logout
    ZimbraAccount account = app.zGetActiveAccount();
    app.zPageMain.zLogout();

    // Share it
    Owner.soapSend(
        "<FolderActionRequest xmlns='urn:zimbraMail'>"
            + "<action id='"
            + folder.getId()
            + "' op='delete'>"
            + "</action>"
            + "</FolderActionRequest>");

    // Login
    app.zPageLogin.zLogin(account);

    // View the folder
    app.zTreeMail.zTreeItem(Action.A_LEFTCLICK, mountpoint);
  }
  @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 = "Run a saved search",
      groups = {"smoke"})
  public void RunSavedSearch_01() throws HarnessException {

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

    // Send two messages with different subjects to the account
    ZimbraAccount.AccountA()
        .soapSend(
            "<SendMsgRequest xmlns='urn:zimbraMail'>"
                + "<m>"
                + "<e t='t' a='"
                + app.zGetActiveAccount().EmailAddress
                + "'/>"
                + "<su>"
                + subject1
                + "</su>"
                + "<mp ct='text/plain'>"
                + "<content>content1"
                + 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>content1"
                + ZimbraSeleniumProperties.getUniqueString()
                + "</content>"
                + "</mp>"
                + "</m>"
                + "</SendMsgRequest>");

    // Create the saved search
    app.zGetActiveAccount()
        .soapSend(
            "<CreateSearchFolderRequest xmlns='urn:zimbraMail'>"
                + "<search name='"
                + name
                + "' query='"
                + query
                + "' l='1'/>"
                + "</CreateSearchFolderRequest>");

    // Get the item
    SavedSearchFolderItem item =
        SavedSearchFolderItem.importFromSOAP(app.zGetActiveAccount(), name);

    // Refresh the folder list
    app.zPageMail.zToolbarPressButton(Button.B_GETMAIL);

    // Left click on the search
    app.zTreeMail.zTreeItem(Action.A_LEFTCLICK, item);

    // Verify the correct messages appear
    List<MailItem> messages = app.zPageMail.zListGetMessages();
    ZAssert.assertNotNull(messages, "Verify the message list exists");

    MailItem found1 = null;
    MailItem found2 = null;
    for (MailItem m : messages) {
      logger.info("Subject: looking for " + subject1 + " found: " + m.gSubject);
      if (subject1.equals(m.gSubject)) {
        found1 = m;
        break;
      }
      logger.info("Subject: looking for " + subject2 + " found: " + m.gSubject);
      if (subject2.equals(m.gSubject)) {
        found2 = m;
        break;
      }
    }
    ZAssert.assertNotNull(found1, "Verify the matched message exists in the inbox");
    ZAssert.assertNull(found2, "Verify the un-match message does not exist in the inbox");
  }
  @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");
  }
Beispiel #24
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");
  }