Esempio n. 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");
  }
Esempio n. 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");
  }