Пример #1
0
  @Bugs(ids = "69132")
  @Test(
      description = "Delete an appointment using Delete toolbar button",
      groups = {"smoke"})
  public void DeleteAppointment_01() throws HarnessException {

    // Creating objects for appointment data
    String tz, apptSubject, apptBody;
    tz = ZTimeZone.TimeZoneEST.getID();
    apptSubject = ZimbraSeleniumProperties.getUniqueString();
    apptBody = ZimbraSeleniumProperties.getUniqueString();

    // 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' 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
                + "'/>"
                + "</inv>"
                + "<mp content-type='text/plain'>"
                + "<content>"
                + apptBody
                + "</content>"
                + "</mp>"
                + "<su>"
                + apptSubject
                + "</su>"
                + "</m>"
                + "</CreateAppointmentRequest>");

    // Right click to appointment and delete it
    app.zPageCalendar.zToolbarPressButton(Button.B_REFRESH);
    app.zPageCalendar.zListItem(Action.A_LEFTCLICK, apptSubject);
    DialogConfirmDeleteAppointment dlgConfirm =
        (DialogConfirmDeleteAppointment) app.zPageCalendar.zToolbarPressButton(Button.B_DELETE);
    dlgConfirm.zClickButton(Button.B_YES);
    dlgConfirm.zWaitForClose();

    ZAssert.assertEquals(
        app.zPageCalendar.zIsAppointmentExists(apptSubject),
        false,
        "Verify appointment is deleted");
  }
Пример #2
0
  @Bugs(ids = "69132")
  @Test(
      description = "Delete an appointment using keyboard shortcuts (Del & Backspace)",
      groups = {"functional"},
      dataProvider = "DataProviderShortcutKeys")
  public void DeleteAppointment_03(String name, int keyEvent) throws HarnessException {

    // Creating objects for appointment data
    String tz, apptSubject, apptBody;
    tz = ZTimeZone.TimeZoneEST.getID();
    apptSubject = ZimbraSeleniumProperties.getUniqueString();
    apptBody = ZimbraSeleniumProperties.getUniqueString();

    // 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' 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
                + "'/>"
                + "</inv>"
                + "<mp content-type='text/plain'>"
                + "<content>"
                + apptBody
                + "</content>"
                + "</mp>"
                + "<su>"
                + apptSubject
                + "</su>"
                + "</m>"
                + "</CreateAppointmentRequest>");
    String apptId =
        app.zGetActiveAccount()
            .soapSelectValue("//mail:CreateAppointmentResponse//mail:appt", "id");

    // Delete appointment using keyboard Del and Backspace key
    app.zPageCalendar.zToolbarPressButton(Button.B_REFRESH);
    app.zPageCalendar.zListItem(Action.A_LEFTCLICK, apptSubject);
    DialogConfirmDeleteAppointment dlgConfirm =
        (DialogConfirmDeleteAppointment) app.zPageCalendar.zKeyboardKeyEvent(keyEvent);
    dlgConfirm.zClickButton(Button.B_YES);

    // -- Verification
    app.zGetActiveAccount()
        .soapSend(
            "<SearchRequest xmlns='urn:zimbraMail' types='appointment' calExpandInstStart='"
                + startUTC.addDays(-7).toMillis()
                + "' calExpandInstEnd='"
                + startUTC.addDays(7).toMillis()
                + "'>"
                + "<query>subject:("
                + apptSubject
                + ")</query>"
                + "</SearchRequest>");

    Element[] nodes = app.zGetActiveAccount().soapSelectNodes("//mail:appt");
    ZAssert.assertEquals(nodes.length, 0, "Verify appointment is deleted");
  }