@Test(
      description = "Measure the time to load the Calendar, month view, 1 appointment",
      groups = {"performance"})
  public void ZmCalendarApp_02() throws HarnessException {

    // Create an appointment
    String subject = "subject" + ZimbraSeleniumProperties.getUniqueString();
    AppointmentItem.createAppointmentSingleDay(
        app.zGetActiveAccount(),
        Calendar.getInstance(),
        60,
        null,
        subject,
        "content" + ZimbraSeleniumProperties.getUniqueString(),
        "location" + ZimbraSeleniumProperties.getUniqueString(),
        null);

    // Start the perf token
    PerfToken token =
        PerfMetrics.startTimestamp(
            PerfKey.ZmCalendarApp, "Load the calendar app, month view, 1 appointment");

    // Go to calendar
    // app.zPageCalendar.zNavigateTo();
    app.zPageCalendar.zClickAt("css=td[id='zb__App__Calendar_title']", "");

    PerfMetrics.waitTimestamp(token);

    // Wait for the app to load
    app.zPageCalendar.zWaitForActive();
  }
예제 #2
0
 /**
  * Get an AppointmentItem using start/end +/- 31 days
  *
  * @param account
  * @param query
  * @return
  * @throws HarnessException
  */
 public static AppointmentItem importFromSOAP(ZimbraAccount account, String query)
     throws HarnessException {
   Calendar now = Calendar.getInstance();
   ZDate date =
       new ZDate(
           now.get(Calendar.YEAR),
           now.get(Calendar.MONTH) + 1,
           now.get(Calendar.DAY_OF_MONTH),
           12,
           0,
           0);
   return (importFromSOAP(account, query, date.addDays(-31), date.addDays(31)));
 }
예제 #3
0
  @Bugs(ids = "69132")
  @Test(
      description = "View a multi-day appointment in the month view",
      groups = {"functional"})
  public void GetAppointment_02() throws HarnessException {

    // Create an appointment on the server
    String subject = "appointment" + ZimbraSeleniumProperties.getUniqueString();

    AppointmentItem.createAppointmentAllDay(
        app.zGetActiveAccount(),
        Calendar.getInstance(),
        2,
        subject,
        "content" + ZimbraSeleniumProperties.getUniqueString(),
        "location" + ZimbraSeleniumProperties.getUniqueString(),
        null);

    // Refresh the calendar
    app.zPageCalendar.zToolbarPressButton(Button.B_REFRESH);

    // Verify appointment displayed in month view
    ZAssert.assertEquals(
        app.zPageCalendar.sIsElementPresent(app.zPageCalendar.zGetAllDayApptLocator(subject)),
        true,
        "Verify appointment present in month view");

    // Below code works fine for single-day all day but for multi-day all day appointment it fails
    // because it finds empty cell

    // List<AppointmentItem> items = app.zPageCalendar.zListGetAppointments();
    // ZAssert.assertNotNull(items, "Get the list of appointments");

    // Verify the appointment is in the view
    // AppointmentItem found = null;
    // for(AppointmentItem item : items) {
    //	if ( item.getSubject().equals(subject) ) {
    //		found = item;
    //		break;
    //	}
    // }

    // ZAssert.assertNotNull(found, "Verify the new appointment appears in the view");

  }
  @Test(
      description = "Measure the time to load the Calendar, month view, 100 appointment",
      groups = {"performance"})
  public void ZmCalendarApp_03() throws HarnessException {

    // What is today?
    Calendar today = Calendar.getInstance();

    // Import 100 appointments using Calendar.ics and REST
    String filename =
        ZimbraSeleniumProperties.getBaseDirectory() + "/data/public/ics/calendar05/Calendar.ics";
    File file = null;

    // Modify the ICS in two ways:
    // 1. Make the current account the organizer
    // 2. Make the dates equal to this month
    file =
        RestUtil.FileUtils.replaceInFile(
            "*****@*****.**", app.zGetActiveAccount().EmailAddress, new File(filename));
    file =
        RestUtil.FileUtils.replaceInFile(
            "201111", (new SimpleDateFormat("yyyyMM")).format(today.getTime()), file);

    RestUtil rest = new RestUtil();
    rest.setAuthentication(app.zGetActiveAccount());
    rest.setPath("/service/home/~/Calendar");
    rest.setQueryParameter("fmt", "ics");
    rest.setUploadFile(file);
    rest.doPost();

    // Start the perf token
    PerfToken token =
        PerfMetrics.startTimestamp(
            PerfKey.ZmCalendarApp, "Load the calendar app, month view, 100 appointment");

    // Go to calendar
    // app.zPageCalendar.zNavigateTo();
    app.zPageCalendar.zClickAt("css=td[id='zb__App__Calendar_title']", "");

    PerfMetrics.waitTimestamp(token);

    // Wait for the app to load
    app.zPageCalendar.zWaitForActive();
  }
예제 #5
0
  @Bugs(ids = "69132")
  @Test(
      description = "View a basic appointment in the month view",
      groups = {"functional"})
  public void GetAppointment_01() throws HarnessException {

    // Create an appointment on the server
    String subject = "appointment" + ZimbraSeleniumProperties.getUniqueString();

    AppointmentItem.createAppointmentAllDay(
        app.zGetActiveAccount(),
        Calendar.getInstance(),
        1,
        subject,
        "content" + ZimbraSeleniumProperties.getUniqueString(),
        "location" + ZimbraSeleniumProperties.getUniqueString(),
        null);

    // Refresh the calendar
    app.zPageCalendar.zToolbarPressButton(Button.B_REFRESH);

    // Get the list of appointments in the current view
    List<AppointmentItem> items = app.zPageCalendar.zListGetAppointments();
    ZAssert.assertNotNull(items, "Get the list of appointments");

    // Verify the appointment is in the view
    AppointmentItem found = null;
    for (AppointmentItem item : items) {
      if (item.getSubject().equals(subject)) {
        found = item;
        break;
      }
    }

    ZAssert.assertNotNull(found, "Verify the new appointment appears in the view");
  }
예제 #6
0
  @Bugs(ids = "69132")
  @Test(
      description = "View a basic appointment in the free busy view",
      groups = {"functional"})
  public void GetAppointment_01() throws HarnessException {

    // Create the appointment on the server
    // Create the message data to be sent
    String subject = "appointment" + ZimbraSeleniumProperties.getUniqueString();

    // Absolute dates in UTC zone
    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);

    // EST timezone string
    String tz = ZTimeZone.TimeZoneEST.getID();

    // Create an appointment
    app.zGetActiveAccount()
        .soapSend(
            "<CreateAppointmentRequest xmlns='urn:zimbraMail'>"
                + "<m>"
                + "<inv>"
                + "<comp status='CONF' fb='B' class='PUB' transp='O' allDay='0' name='"
                + subject
                + "' >"
                + "<s d='"
                + startUTC.toTimeZone(tz).toYYYYMMDDTHHMMSS()
                + "' tz='"
                + tz
                + "'/>"
                + "<e d='"
                + endUTC.toTimeZone(tz).toYYYYMMDDTHHMMSS()
                + "' tz='"
                + tz
                + "'/>"
                + "<or a='"
                + app.zGetActiveAccount().EmailAddress
                + "'/>"
                + "</comp>"
                + "</inv>"
                + "<su>"
                + subject
                + "</su>"
                + "<mp ct='text/plain'>"
                + "<content>content</content>"
                + "</mp>"
                + "</m>"
                + "</CreateAppointmentRequest>");

    // -- GUI Actions

    // Go to F/B view
    SleepUtil.sleepMedium();
    app.zPageCalendar.zToolbarPressPulldown(Button.B_LISTVIEW, Button.O_LISTVIEW_FREEBUSY);

    // -- Verification

    // Verify the appointment appears on the page
    SleepUtil.sleepMedium(); // test fails without sleep because calendar view rendering takes time
    ZAssert.assertTrue(
        app.zPageCalendar.zGetApptLocatorFreeBusyView(
            app.zGetActiveAccount().EmailAddress, subject),
        "Verify attendee free/busy row exists");
  }
예제 #7
0
  @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'");
  }
예제 #8
0
  @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");
  }
예제 #9
0
  @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>");
  }