@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(); }
@Bugs(ids = "69132") @Test( description = "View a basic all-day appointment in the work week view", groups = { "smoke" }) public void GetAllDayAppointment_01() throws HarnessException { // Create the appointment on the server String apptSubject = "appointment" + ZimbraSeleniumProperties.getUniqueString(); String apptLocation = "location" + ZimbraSeleniumProperties.getUniqueString(); String apptBody = "content" + 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); // EST timezone string String tz = ZTimeZone.TimeZoneEST.getID(); // Create a meeting request from AccountA to the test account ZimbraAccount.AccountA().soapSend( "<CreateAppointmentRequest xmlns='urn:zimbraMail'>" + "<m>" + "<inv>" + "<comp status='CONF' fb='B' class='PUB' transp='O' allDay='1' name='"+ apptSubject +"' loc='"+ apptLocation +"'>" + "<s d='"+ startUTC.toTimeZone(tz).toYYYYMMDDTHHMMSS() +"' tz='"+ tz +"'/>" + "<e d='"+ endUTC.toTimeZone(tz).toYYYYMMDDTHHMMSS() +"' tz='"+ tz +"'/>" + "<at role='REQ' ptst='NE' rsvp='1' a='"+ app.zGetActiveAccount().EmailAddress +"'/>" + "<or a='"+ ZimbraAccount.AccountA().EmailAddress + "'/>" + "</comp>" + "</inv>" + "<e a='"+ app.zGetActiveAccount().EmailAddress +"' t='t'/>" + "<su>"+ apptSubject + "</su>" + "<mp ct='text/plain'>" + "<content>"+ apptBody +"</content>" + "</mp>" + "</m>" + "</CreateAppointmentRequest>"); AppointmentItem appt = AppointmentItem.importFromSOAP(app.zGetActiveAccount(), "subject:("+ apptSubject +")", startUTC.addDays(-7), endUTC.addDays(7)); ZAssert.assertNotNull(appt, "Verify the new appointment is created"); app.zPageCalendar.zToolbarPressButton(Button.B_REFRESH); //wait for the appointment displayed in the view ZAssert.assertEquals(app.zPageCalendar.sIsElementPresent(app.zPageCalendar.zGetReadOnlyAllDayApptLocator(apptSubject)), true, "Verify all-day appointment is deleted"); }
@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"); }
@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"); }
@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"); }
@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"); }
@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"); }
@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'"); }
@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 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>"); }