Пример #1
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");
  }
Пример #2
0
  @Bugs(ids = "69132")
  @Test(
      description =
          "Delete instance of series appointment (every week) using keyboard shortcuts Del & Backspace",
      groups = {"functional"},
      dataProvider = "DataProviderShortcutKeys")
  public void DeleteInstance_06(String name, int keyEvent) throws HarnessException {

    // -- Data Setup

    // Appointment data
    String tz, apptSubject, apptBody;
    tz = ZTimeZone.TimeZoneEST.getID();
    apptSubject = "subject" + ZimbraSeleniumProperties.getUniqueString();
    apptBody = "body" + ZimbraSeleniumProperties.getUniqueString();

    // Absolute dates in UTC zone
    Calendar now = this.calendarWeekDayUTC;
    ZDate startTime =
        new ZDate(
            now.get(Calendar.YEAR),
            now.get(Calendar.MONTH) + 1,
            now.get(Calendar.DAY_OF_MONTH),
            12,
            0,
            0);
    ZDate endTime =
        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='"
                + startTime.toTimeZone(tz).toYYYYMMDDTHHMMSS()
                + "' tz='"
                + tz
                + "'/>"
                + "<e d='"
                + endTime.toTimeZone(tz).toYYYYMMDDTHHMMSS()
                + "' tz='"
                + tz
                + "'/>"
                + "<or a='"
                + app.zGetActiveAccount().EmailAddress
                + "'/>"
                + "<recur>"
                + "<add>"
                + "<rule freq='MON'>"
                + "<interval ival='1'/>"
                + "</rule>"
                + "</add>"
                + "</recur>"
                + "</inv>"
                + "<mp content-type='text/plain'>"
                + "<content>"
                + apptBody
                + "</content>"
                + "</mp>"
                + "<su>"
                + apptSubject
                + "</su>"
                + "</m>"
                + "</CreateAppointmentRequest>");

    // -- GUI actions

    // Delete instance and verify corresponding UI
    app.zPageCalendar.zToolbarPressButton(Button.B_REFRESH);

    app.zPageCalendar.zListItem(Action.A_LEFTCLICK, apptSubject);

    DialogWarning dialogSeriesOrInstance =
        (DialogWarning) app.zPageCalendar.zKeyboardKeyEvent(keyEvent);
    dialogSeriesOrInstance.zClickButton(Button.B_DELETE_THIS_INSTANCE);
    DialogWarning confirmDelete = (DialogWarning) dialogSeriesOrInstance.zClickButton(Button.B_OK);
    confirmDelete.zClickButton(Button.B_YES);

    // -- Verification

    // On the server, verify the appointment is in the trash
    app.zGetActiveAccount()
        .soapSend(
            "<SearchRequest xmlns='urn:zimbraMail' types='appointment' calExpandInstStart='"
                + startTime.addDays(-7).toMillis()
                + "' calExpandInstEnd='"
                + endTime.addDays(7).toMillis()
                + "'>"
                + "<query>is:anywhere "
                + apptSubject
                + "</query>"
                + "</SearchRequest>");

    // http://bugzilla.zimbra.com/show_bug.cgi?id=63412 - "Deleting instance from calendar series
    // does not allow for user restoration from the Trash can"
    // http://bugzilla.zimbra.com/show_bug.cgi?id=13527#c4 - "Moving an instance from one cal to
    // other, moves complete series"
    // For now, nothing should be returned in the SearchResponse
    //
    //		String folderID = app.zGetActiveAccount().soapSelectValue("//mail:appt", "l");
    //		ZAssert.assertEquals(
    //				folderID,
    //				FolderItem.importFromSOAP(app.zGetActiveAccount(), SystemFolder.Trash).getId(),
    //				"Verify appointment is in the trash folder");

    Element[] appts = app.zGetActiveAccount().soapSelectNodes("//mail:appt");
    ZAssert.assertEquals(
        appts.length, 0, "Verify the appt element does not exist ... See also bug 63412");

    // Verify the appointment is not in the GUI view
    // ZAssert.assertEquals(app.zPageCalendar.sIsElementPresent(app.zPageCalendar.zGetApptLocator(apptSubject)), false, "Verify instance is deleted from the calendar");
    boolean deleted =
        app.zPageCalendar.zWaitForElementDeleted(
            app.zPageCalendar.zGetApptLocator(apptSubject), "10000");
    ZAssert.assertEquals(deleted, true, "Verify instance is deleted from the calendar");
  }
Пример #3
0
  @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();
    }
  }
Пример #4
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);
  }