@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"); }
/** * ZimbraAccount.AccountA() sends a two-hour appointment to app.zGetActiveAccount() with subject * and start time * * @param subject * @param start * @throws HarnessException */ private void SendCreateAppointmentRequest(String subject, ZDate start) throws HarnessException { 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='" + subject + "'>" + "<s d='" + start.toTimeZone(ZTimeZone.TimeZoneEST.getID()).toYYYYMMDDTHHMMSS() + "' tz='" + ZTimeZone.TimeZoneEST.getID() + "'/>" + "<e d='" + start.addHours(2).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>" + subject + "</su>" + "<mp content-type='text/plain'>" + "<content>content</content>" + "</mp>" + "</m>" + "</CreateAppointmentRequest>"); }
@Test( description = "Mark a message as read by clicking on it then waiting", groups = {"smoke"}) public void MarkReadMail_01() 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); // Wait to read the message SleepUtil.sleep(1000L * (delaySeconds)); // Wait the for the client to send the change to the server app.zPageMail.zWaitForBusyOverlay(); // Verify the message is marked read in the server (flags attribute should not contain (u)nread) mail = MailItem.importFromSOAP(app.zGetActiveAccount(), "subject:(" + subject + ")"); ZAssert.assertStringDoesNotContain( mail.getFlags(), "u", "Verify the message is marked read in the server"); // TODO: Verify the message is not marked unread in the list }
@Test( description = "Mark a message as read by clicking on it, then using 'mr' hotkeys", groups = {"functional"}) public void MarkReadMail_03() 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); // TODO: need to L10N this app.zPageMail.zKeyboardShortcut(Shortcut.S_MAIL_MARKREAD); // Verify the message is marked read in the server (flags attribute should not contain (u)nread) mail = MailItem.importFromSOAP(app.zGetActiveAccount(), "subject:(" + subject + ")"); ZAssert.assertStringDoesNotContain( mail.getFlags(), "u", "Verify the message is marked read in the server"); // TODO: Verify the message is not marked unread in the list }
@Bugs(ids = "69132") @Test( description = "Create simple all day appointment in week view", groups = {"smoke"}) public void CreateAllDayAppointment_01() throws HarnessException { // Create appointment String apptSubject; apptSubject = "appointment" + ZimbraSeleniumProperties.getUniqueString(); AppointmentItem appt = new AppointmentItem(); appt.setSubject(apptSubject); appt.setContent("content" + ZimbraSeleniumProperties.getUniqueString()); appt.setAttendees(ZimbraAccount.AccountA().EmailAddress); appt.setIsAllDay(true); // Open the new mail form FormApptNew apptForm = (FormApptNew) app.zPageCalendar.zToolbarPressButton(Button.B_NEW); apptForm.zFill(appt); apptForm.zSubmit(); // Verify the new appointment exists on the server AppointmentItem actual = AppointmentItem.importFromSOAP( app.zGetActiveAccount(), "subject:(" + appt.getSubject() + ")"); ZAssert.assertNotNull(actual, "Verify the new appointment is created"); ZAssert.assertEquals( actual.getSubject(), appt.getSubject(), "Subject: Verify the appointment data"); ZAssert.assertEquals( app.zGetActiveAccount() .soapMatch("//mail:GetAppointmentResponse//mail:comp", "allDay", "1"), true, ""); // Verify in UI app.zPageCalendar.zToolbarPressButton(Button.B_REFRESH); ZAssert.assertEquals( app.zPageCalendar.sIsElementPresent(app.zPageCalendar.zGetAllDayApptLocator(apptSubject)), true, "Verify all-day appointment present in UI"); }
@Test( description = "Mark a message as read by context menu -> mark read", groups = {"functional"}) public void MarkReadMail_04() 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); app.zPageMail.zListItem(Action.A_RIGHTCLICK, Button.O_MARK_AS_READ, mail.dSubject); // Verify the message is marked read in the server (flags attribute should not contain (u)nread) mail = MailItem.importFromSOAP(app.zGetActiveAccount(), "subject:(" + subject + ")"); ZAssert.assertStringDoesNotContain( mail.getFlags(), "u", "Verify the message is marked read in the server"); }
@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"); }
@Test( description = "Create weekly recurring invite with attendee and location with every Monday, end after 2 occurrences", groups = {"smoke"}) public void WeeklyEveryXdayEndAfterYoccurrences_01() throws HarnessException { // Create appointment data AppointmentItem appt = new AppointmentItem(); String apptSubject, apptAttendee, apptContent, apptLocation; ZimbraResource location = new ZimbraResource(ZimbraResource.Type.LOCATION); apptSubject = ZimbraSeleniumProperties.getUniqueString(); apptAttendee = ZimbraAccount.AccountA().EmailAddress; apptContent = ZimbraSeleniumProperties.getUniqueString(); apptLocation = location.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), 20, 0, 0); ZDate endUTC = new ZDate( now.get(Calendar.YEAR), now.get(Calendar.MONTH) + 1, now.get(Calendar.DAY_OF_MONTH), 22, 0, 0); appt.setSubject(apptSubject); appt.setAttendees(apptAttendee); appt.setStartTime(startUTC); appt.setEndTime(endUTC); appt.setLocation(apptLocation); appt.setContent(apptContent); // Compose appointment and send it to invitee FormApptNew apptForm = (FormApptNew) app.zPageCalendar.zToolbarPressButton(Button.B_NEW); apptForm.zFill(appt); apptForm.zRepeat( Button.O_EVERY_WEEK_MENU, Button.B_EVERY_X_RADIO_BUTTON, "Monday", Button.B_END_AFTER_X_OCCURRENCES_RADIO_BUTTON, "2"); ZAssert.assertStringContains( app.zPageCalendar.zGetRecurringLink(), "Every Monday End after 2 occurrence(s) Effective ", "Recurring link: Verify the appointment data"); apptForm.zSubmit(); SleepUtil.sleepLong(); // SOAP gives wrong response 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"); app.zGetActiveAccount() .soapSend("<GetAppointmentRequest xmlns='urn:zimbraMail' id='" + attendeeInvId + "'/>"); String ruleFrequency = app.zGetActiveAccount().soapSelectValue("//mail:appt//mail:rule", "freq"); String count = app.zGetActiveAccount().soapSelectValue("//mail:appt//mail:count", "num"); String interval = app.zGetActiveAccount().soapSelectValue("//mail:appt//mail:interval", "ival"); String weekday = app.zGetActiveAccount().soapSelectValue("//mail:appt//mail:wkday", "day"); // Verify appointment exists on server meeting with correct recurring details AppointmentItem actual = AppointmentItem.importFromSOAP( app.zGetActiveAccount(), "subject:(" + appt.getSubject() + ")", appt.getStartTime().addDays(-7), appt.getEndTime().addDays(7)); ZAssert.assertNotNull(actual, "Verify the new appointment is created"); ZAssert.assertEquals( actual.getSubject(), appt.getSubject(), "Subject: Verify the appointment data"); ZAssert.assertEquals( actual.getAttendees(), apptAttendee, "Attendees: Verify the appointment data"); ZAssert.assertEquals( actual.getLocation(), apptLocation, "Location: Verify the appointment data"); ZAssert.assertEquals(ruleFrequency, "WEE", "Repeat frequency: Verify the appointment data"); ZAssert.assertEquals(count, "2", "No. of occurrences: Verify the appointment data"); ZAssert.assertEquals(interval, "1", "Repeat interval: Verify the appointment data"); ZAssert.assertEquals(weekday, "MO", "Weekday: Verify the appointment data"); ZAssert.assertEquals( actual.getContent(), appt.getContent(), "Content: Verify the appointment data"); // Verify location free/busy status shows as psts=AC String locationStatus = app.zGetActiveAccount().soapSelectValue("//mail:at[@a='" + apptLocation + "']", "ptst"); ZAssert.assertEquals( locationStatus, "AC", "Verify that the location status shows as 'ACCEPTED'"); ZimbraAccount.AccountA() .soapSend( "<SearchRequest xmlns='urn:zimbraMail' types='appointment' calExpandInstStart='" + startUTC.addDays(-10).toMillis() + "' calExpandInstEnd='" + endUTC.addDays(10).toMillis() + "'>" + "<query>" + apptSubject + "</query>" + "</SearchRequest>"); attendeeInvId = ZimbraAccount.AccountA().soapSelectValue("//mail:appt", "invId"); ZimbraAccount.AccountA() .soapSend("<GetAppointmentRequest xmlns='urn:zimbraMail' id='" + attendeeInvId + "'/>"); ruleFrequency = app.zGetActiveAccount().soapSelectValue("//mail:appt//mail:rule", "freq"); count = app.zGetActiveAccount().soapSelectValue("//mail:appt//mail:count", "num"); interval = app.zGetActiveAccount().soapSelectValue("//mail:appt//mail:interval", "ival"); weekday = app.zGetActiveAccount().soapSelectValue("//mail:appt//mail:wkday", "day"); // Verify the attendee receives the meeting with correct recurring details AppointmentItem received = AppointmentItem.importFromSOAP( ZimbraAccount.AccountA(), "subject:(" + appt.getSubject() + ")", appt.getStartTime().addDays(-7), appt.getEndTime().addDays(7)); ZAssert.assertNotNull(received, "Verify the new appointment is created"); ZAssert.assertEquals( received.getSubject(), appt.getSubject(), "Subject: Verify the appointment data"); ZAssert.assertEquals( received.getAttendees(), apptAttendee, "Attendees: Verify the appointment data"); ZAssert.assertEquals( received.getLocation(), apptLocation, "Location: Verify the appointment data"); ZAssert.assertEquals(ruleFrequency, "WEE", "Repeat frequency: Verify the appointment data"); ZAssert.assertEquals(count, "2", "No. of occurrences: Verify the appointment data"); ZAssert.assertEquals(interval, "1", "Repeat interval: Verify the appointment data"); ZAssert.assertEquals(weekday, "MO", "Weekday: Verify the appointment data"); ZAssert.assertEquals( received.getContent(), appt.getContent(), "Content: Verify the appointment data"); // Verify the attendee receives the invitation MailItem invite = MailItem.importFromSOAP(ZimbraAccount.AccountA(), "subject:(" + appt.getSubject() + ")"); ZAssert.assertNotNull(invite, "Verify the invite is received"); ZAssert.assertEquals( invite.dSubject, appt.getSubject(), "Subject: Verify the appointment data"); // Go to next/previous week and verify correct number of recurring instances app.zPageCalendar.zToolbarPressButton(Button.B_NEXT_PAGE); SleepUtil.sleepMedium(); // Let UI draw first and important for calendar testcases reliability ZAssert.assertEquals( app.zPageCalendar.zGetApptCountWorkWeekView(), 2, "Verify correct no. of recurring instances are present in calendar view"); app.zPageCalendar.zToolbarPressButton(Button.B_NEXT_PAGE); app.zPageCalendar.zToolbarPressButton(Button.B_NEXT_PAGE); SleepUtil.sleepMedium(); // Let UI draw first and important for calendar testcases reliability ZAssert.assertEquals( app.zPageCalendar.zGetApptCountWorkWeekView(), 0, "Verify correct no. of recurring instances are present in calendar view"); }
@Bugs(ids = "81920") @Test( description = "Reply to a conversation with a draft", groups = {"functional"}) public void Bug81920_01() throws HarnessException { // -- DATA // Create a conversation ConversationItem c = ConversationItem.createConversationItem(app.zGetActiveAccount()); // Create a draft in the conversation // First, need to determine the last message received int id = 0; for (MailItem m : c.getMessageList()) { if (Integer.parseInt(m.getId()) > id) { id = Integer.parseInt(m.getId()); } } String body = "draft" + ZimbraSeleniumProperties.getUniqueString(); app.zGetActiveAccount() .soapSend( "<SaveDraftRequest xmlns='urn:zimbraMail'>" + "<m origid='" + id + "' rt='r'>" + "<e t='t' a='" + ZimbraAccount.AccountA().EmailAddress + "'/>" + "<su>RE: " + c.getSubject() + "</su>" + "<mp ct='text/plain'>" + "<content>" + body + "</content>" + "</mp>" + "</m>" + "</SaveDraftRequest>"); // Change the whole conversation to be unread app.zGetActiveAccount() .soapSend( "<ItemActionRequest xmlns='urn:zimbraMail'>" + "<action op='!read' id='" + c.getId() + "'/>" + "</ItemActionRequest>"); // -- GUI // Click Get Mail button app.zPageMail.zToolbarPressButton(Button.B_GETMAIL); // Select the item app.zPageMail.zListItem(Action.A_LEFTCLICK, c.getSubject()); // Click reply FormMailNew mailform = (FormMailNew) app.zPageMail.zToolbarPressButton(Button.B_REPLY); ZAssert.assertNotNull(mailform, "Verify the new form opened"); // Send the message mailform.zSubmit(); // -- Verification // From the test account, check the sent folder for the reply MailItem sent = MailItem.importFromSOAP( app.zGetActiveAccount(), "in:sent subject:(" + c.getSubject() + ")"); ZAssert.assertNotNull(sent, "Verify the sent message in the sent folder"); // Verify the draft body does not appear in the reply ZAssert.assertStringDoesNotContain( sent.dBodyText, body, "Verify the draft body does not appear in the reply"); }
@Test( description = "Close modifying appt and take action from warning dialog : Dont save But keep open", groups = {"functional"}) public void ModifyAppointment_03() throws HarnessException { // Creating object for appointment data AppointmentItem appt = new AppointmentItem(); String tz, apptSubject, apptAttendee1, apptAttendee2, editApptSubject; tz = ZTimeZone.TimeZoneEST.getID(); apptSubject = ZimbraSeleniumProperties.getUniqueString(); editApptSubject = ZimbraSeleniumProperties.getUniqueString(); apptAttendee1 = ZimbraAccount.AccountA().EmailAddress; apptAttendee2 = ZimbraAccount.AccountB().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'/>" + "<at role='REQ' ptst='NE' rsvp='1' a='" + apptAttendee2 + "' d='2'/>" + "</inv>" + "<e a='" + ZimbraAccount.AccountA().EmailAddress + "' t='t'/>" + "<mp content-type='text/plain'>" + "<content>" + ZimbraSeleniumProperties.getUniqueString() + "</content>" + "</mp>" + "<su>" + apptSubject + "</su>" + "</m>" + "</CreateAppointmentRequest>"); app.zPageCalendar.zToolbarPressButton(Button.B_REFRESH); String apptId = app.zGetActiveAccount().soapSelectValue("//mail:CreateAppointmentResponse", "apptId"); // Try to remove attendee and press close button app.zPageCalendar.zListItem(Action.A_DOUBLECLICK, apptSubject); FormApptNew apptForm = new FormApptNew(app); appt.setSubject(editApptSubject); apptForm.zRemoveAttendee(apptAttendee2); apptForm.zToolbarPressButton(Button.B_CLOSE); DialogConfirmModification confirmClose = (DialogConfirmModification) new DialogConfirmModification(app, app.zPageCalendar); confirmClose.zClickButton(Button.B_DONTSAVE_KEEP_OPEN); confirmClose.zClickButton(Button.B_SAVE_MODIFICATION); // Verify 'Save Appointment' dialog is closed ZAssert.assertFalse(confirmClose.zIsActive(), "Verify 'Save Appointment' dialog is closed"); // Verify new appt page is still open ZAssert.assertFalse(apptForm.zVerifyNewApptTabClosed(), "Verify new appt page is still open"); app.zGetActiveAccount() .soapSend("<GetAppointmentRequest xmlns='urn:zimbraMail' id='" + apptId + "'/>"); AppointmentItem modifyAppt = AppointmentItem.importFromSOAP(ZimbraAccount.AccountA(), "subject:(" + apptSubject + ")"); // Verify that appointment subject is not modified ZAssert.assertEquals( app.zGetActiveAccount() .soapMatch("//mail:GetAppointmentResponse//mail:comp", "name", apptSubject), true, ""); // Verify meeting attendees remains as it is ZAssert.assertStringContains( modifyAppt.getAttendees(), apptAttendee2, "Attendees: Verify attendee1 is present in the meeting invite"); ZAssert.assertStringContains( modifyAppt.getAttendees(), apptAttendee1, "Attendees: Verify attendee2 is present in the meeting invite"); }
@Test( description = "Close modifying appt and take action from warning dialog : Save Changes and send updates", groups = {"functional"}) public void ModifyAppointment_01() throws HarnessException { // Create appointment data String tz, apptSubject, apptAttendee1, apptAttendee2; apptSubject = ZimbraSeleniumProperties.getUniqueString(); apptAttendee1 = ZimbraAccount.AccountA().EmailAddress; apptAttendee2 = ZimbraAccount.AccountB().EmailAddress; // Absolute dates in UTC zone tz = ZTimeZone.TimeZoneEST.getID(); 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); // Create appointment 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'/>" + "<at role='REQ' ptst='NE' rsvp='1' a='" + apptAttendee2 + "' d='2'/>" + "</inv>" + "<e a='" + ZimbraAccount.AccountA().EmailAddress + "' t='t'/>" + "<mp content-type='text/plain'>" + "<content>" + ZimbraSeleniumProperties.getUniqueString() + "</content>" + "</mp>" + "<su>" + apptSubject + "</su>" + "</m>" + "</CreateAppointmentRequest>"); app.zPageCalendar.zToolbarPressButton(Button.B_REFRESH); // Remove attendee and close the appt app.zPageCalendar.zListItem(Action.A_DOUBLECLICK, apptSubject); FormApptNew apptForm = new FormApptNew(app); apptForm.zRemoveAttendee(apptAttendee2); apptForm.zToolbarPressButton(Button.B_CLOSE); DialogConfirmModification confirmClose = (DialogConfirmModification) new DialogConfirmModification(app, app.zPageCalendar); confirmClose.zClickButton(Button.B_SAVE_MODIFICATION); DialogSendUpdatetoAttendees sendUpdateDialog = (DialogSendUpdatetoAttendees) new DialogSendUpdatetoAttendees(app, app.zPageCalendar); sendUpdateDialog.zClickButton(Button.B_OK); // Verify if an attendee is removed from appt and attendee gets update AppointmentItem actual = AppointmentItem.importFromSOAP(app.zGetActiveAccount(), "subject:(" + apptSubject + ")"); ZAssert.assertEquals(actual.getSubject(), apptSubject, "Subject: Verify the appointment data"); ZAssert.assertStringDoesNotContain( actual.getAttendees(), apptAttendee2, "Attendees: Verify the attendee data"); // Verify attendee2 receives cancellation message ZimbraAccount.AccountB() .soapSend( "<SearchRequest xmlns='urn:zimbraMail' types='message'>" + "<query>subject:" + (char) 34 + "Cancelled: " + apptSubject + (char) 34 + "</query>" + "</SearchRequest>"); String id = ZimbraAccount.AccountB().soapSelectValue("//mail:m", "id"); ZAssert.assertNotNull(id, "Verify attendee2 receives cancelled meeting message"); // Verify appointment is deleted from attendee2's calendar AppointmentItem removedAttendee = AppointmentItem.importFromSOAP(ZimbraAccount.AccountB(), "subject:(" + apptSubject + ")"); ZAssert.assertNull(removedAttendee, "Verify meeting is deleted from attendee2's calendar"); }
@Bugs(ids = "63796") @Test( description = "Verify Permission Denied on Spam (keyboard='ms') a shared mail (read-only share)", groups = {"functional"}) public void MarkSpamMessage_02() throws HarnessException { String foldername = "folder" + ZimbraSeleniumProperties.getUniqueString(); String subject = "subject" + ZimbraSeleniumProperties.getUniqueString(); String mountpointname = "mountpoint" + ZimbraSeleniumProperties.getUniqueString(); FolderItem inbox = FolderItem.importFromSOAP(ZimbraAccount.AccountA(), FolderItem.SystemFolder.Inbox); // Create a folder to share ZimbraAccount.AccountA() .soapSend( "<CreateFolderRequest xmlns='urn:zimbraMail'>" + "<folder name='" + foldername + "' l='" + inbox.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'/>" + "</action>" + "</FolderActionRequest>"); // Add a message to it ZimbraAccount.AccountA() .soapSend( "<AddMsgRequest xmlns='urn:zimbraMail'>" + "<m l='" + folder.getId() + "' >" + "<content>From: [email protected]\n" + "To: [email protected] \n" + "Subject: " + subject + "\n" + "MIME-Version: 1.0 \n" + "Content-Type: text/plain; charset=utf-8 \n" + "Content-Transfer-Encoding: 7bit\n" + "\n" + "simple text string in the body\n" + "</content>" + "</m>" + "</AddMsgRequest>"); MailItem mail = MailItem.importFromSOAP(ZimbraAccount.AccountA(), "subject:(" + subject + ")"); // Mount it app.zGetActiveAccount() .soapSend( "<CreateMountpointRequest xmlns='urn:zimbraMail'>" + "<link l='1' name='" + mountpointname + "' rid='" + folder.getId() + "' zid='" + ZimbraAccount.AccountA().ZimbraId + "'/>" + "</CreateMountpointRequest>"); FolderMountpointItem mountpoint = FolderMountpointItem.importFromSOAP(app.zGetActiveAccount(), mountpointname); // Click Get Mail button app.zPageMail.zToolbarPressButton(Button.B_GETMAIL); // For some reason, it takes a bit of time for this share to show up SleepUtil.sleepMedium(); // Click on the mountpoint app.zTreeMail.zTreeItem(Action.A_LEFTCLICK, mountpoint); // Select the item app.zPageMail.zListItem(Action.A_LEFTCLICK, mail.dSubject); // Spam the item app.zPageMail.zKeyboardShortcut(Shortcut.S_MAIL_MARKSPAM); // http://bugzilla.zimbra.com/show_bug.cgi?id=63796 // A "Permission Denied" error popup should not occur DialogError dialog = app.zPageMain.zGetErrorDialog(DialogError.DialogErrorID.Zimbra); ZAssert.assertNotNull(dialog, "Verify the PERM DENIED Error Dialog is created"); ZAssert.assertFalse(dialog.zIsActive(), "Verify the PERM DENIED Error Dialog is not active"); // Verify the message is still in the owner's folder mail = MailItem.importFromSOAP(ZimbraAccount.AccountA(), "subject:(" + subject + ")"); ZAssert.assertEquals( mail.dFolderId, folder.getId(), "Verify the message is still in the owner's folder"); }
@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); }
@Test( description = "Verify that if the message is not read for less than zimbraPrefMarkMsgRead, it is not read", groups = {"functional"}) public void MarkReadMail_02() throws HarnessException { // Create the message data to be sent String subject1 = "subject" + ZimbraSeleniumProperties.getUniqueString(); String subject2 = "subject" + ZimbraSeleniumProperties.getUniqueString(); ZimbraAccount.AccountA() .soapSend( "<SendMsgRequest xmlns='urn:zimbraMail'>" + "<m>" + "<e t='t' a='" + app.zGetActiveAccount().EmailAddress + "'/>" + "<su>" + subject1 + "</su>" + "<mp ct='text/plain'>" + "<content>content" + 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>content" + ZimbraSeleniumProperties.getUniqueString() + "</content>" + "</mp>" + "</m>" + "</SendMsgRequest>"); // Create a mail item to represent the message MailItem mail1 = MailItem.importFromSOAP(app.zGetActiveAccount(), "subject:(" + subject1 + ")"); MailItem mail2 = MailItem.importFromSOAP(app.zGetActiveAccount(), "subject:(" + subject2 + ")"); // Click Get Mail button app.zPageMail.zToolbarPressButton(Button.B_GETMAIL); // Select the item app.zPageMail.zListItem(Action.A_LEFTCLICK, mail1.dSubject); // Select the next item immediately app.zPageMail.zListItem(Action.A_LEFTCLICK, mail2.dSubject); // Verify the message is marked read in the server (flags attribute should not contain (u)nread) mail1 = MailItem.importFromSOAP(app.zGetActiveAccount(), "subject:(" + subject1 + ")"); ZAssert.assertStringContains( mail1.getFlags(), "u", "Verify the message is marked read in the server"); // TODO: Verify the message is not marked unread in the list }
@Test( description = "Delete a conversation - 1 message in inbox, 1 message in sent, 1 message in subfolder", groups = {"functional"}) public void DeleteConversation_10() throws HarnessException { // -- DATA // Create a conversation (3 messages) ConversationItem c = ConversationItem.createConversationItem(app.zGetActiveAccount()); // Put one message in inbox, one in trash, one in subfolder // Get the system folders FolderItem inbox = FolderItem.importFromSOAP(app.zGetActiveAccount(), SystemFolder.Inbox); FolderItem trash = FolderItem.importFromSOAP(app.zGetActiveAccount(), SystemFolder.Trash); FolderItem sent = FolderItem.importFromSOAP(app.zGetActiveAccount(), SystemFolder.Sent); // Move the conversation to the trash app.zGetActiveAccount() .soapSend( "<ItemActionRequest xmlns='urn:zimbraMail'>" + "<action op='move' l='" + trash.getId() + "' id='" + c.getMessageList().get(0).getId() + "'/>" + "</ItemActionRequest>"); // Create a message in a subfolder String foldername = "folder" + ZimbraSeleniumProperties.getUniqueString(); app.zGetActiveAccount() .soapSend( "<CreateFolderRequest xmlns='urn:zimbraMail'>" + "<folder name='" + foldername + "' l='" + inbox.getId() + "'/>" + "</CreateFolderRequest>"); FolderItem subfolder = FolderItem.importFromSOAP(app.zGetActiveAccount(), foldername); // Move the conversation to the subfolder app.zGetActiveAccount() .soapSend( "<ItemActionRequest xmlns='urn:zimbraMail'>" + "<action op='move' l='" + subfolder.getId() + "' id='" + c.getMessageList().get(1).getId() + "'/>" + "</ItemActionRequest>"); // Reply to one message (putting a message in sent) app.zGetActiveAccount() .soapSend( "<SendMsgRequest xmlns='urn:zimbraMail'>" + "<m origid='" + c.getMessageList().get(2).getId() + "' rt='r'>" + "<e t='t' a='" + ZimbraAccount.AccountA().EmailAddress + "'/>" + "<su>RE: " + c.getSubject() + "</su>" + "<mp ct='text/plain'>" + "<content>" + "body" + ZimbraSeleniumProperties.getUniqueString() + "</content>" + "</mp>" + "</m>" + "</SendMsgRequest>"); String idSent = app.zGetActiveAccount().soapSelectValue("//mail:m", "id"); // -- GUI // Click Get Mail button app.zPageMail.zToolbarPressButton(Button.B_GETMAIL); // Right click the item, select delete app.zPageMail.zListItem(Action.A_RIGHTCLICK, Button.B_DELETE, c.getSubject()); // -- Verification // Expected: all messages should be in trash, except for the sent message // Check each message to verify they exist in the trash ConversationItem actual = ConversationItem.importFromSOAP( app.zGetActiveAccount(), "is:anywhere subject:" + c.getSubject()); for (MailItem m : actual.getMessageList()) { if (idSent.equals(m.getId())) { // Sent message should remain in sent ZAssert.assertEquals( m.dFolderId, sent.getId(), "Verify the conversation message is in the sent folder"); } else { // All other messages should be moved to trash ZAssert.assertEquals( m.dFolderId, trash.getId(), "Verify the conversation message is in the trash"); } } }
@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 = "86168") @Test( description = "Forward (on behalf of) to a message in a shared folder (admin rights)", groups = {"functional"}) public void ForwardMail_01() throws HarnessException { // -- DATA // Create the folder owner ZimbraAccount owner = (new ZimbraAccount()).provision().authenticate(); // Allow sending rights owner.soapSend( "<GrantRightsRequest xmlns='urn:zimbraAccount'>" + "<ace gt='usr' d='" + app.zGetActiveAccount().EmailAddress + "' right='sendOnBehalfOf'/>" + "</GrantRightsRequest>"); String foldername = "folder" + ZimbraSeleniumProperties.getUniqueString(); String subject = "subject" + ZimbraSeleniumProperties.getUniqueString(); String mountpointname = "mountpoint" + ZimbraSeleniumProperties.getUniqueString(); FolderItem inbox = FolderItem.importFromSOAP(owner, FolderItem.SystemFolder.Inbox); // Create a folder to share owner.soapSend( "<CreateFolderRequest xmlns='urn:zimbraMail'>" + "<folder name='" + foldername + "' l='" + inbox.getId() + "'/>" + "</CreateFolderRequest>"); FolderItem folder = FolderItem.importFromSOAP(owner, foldername); // Share it owner.soapSend( "<FolderActionRequest xmlns='urn:zimbraMail'>" + "<action id='" + folder.getId() + "' op='grant'>" + "<grant d='" + app.zGetActiveAccount().EmailAddress + "' gt='usr' perm='r'/>" + "</action>" + "</FolderActionRequest>"); // Add a message to it owner.soapSend( "<AddMsgRequest xmlns='urn:zimbraMail'>" + "<m l='" + folder.getId() + "' >" + "<content>From: " + ZimbraAccount.AccountB().EmailAddress + "\n" + "To: " + owner.EmailAddress + "\n" + "Subject: " + subject + "\n" + "MIME-Version: 1.0 \n" + "Content-Type: text/plain; charset=utf-8 \n" + "Content-Transfer-Encoding: 7bit\n" + "\n" + "simple text string in the body\n" + "</content>" + "</m>" + "</AddMsgRequest>"); // Mount it app.zGetActiveAccount() .soapSend( "<CreateMountpointRequest xmlns='urn:zimbraMail'>" + "<link l='1' name='" + mountpointname + "' rid='" + folder.getId() + "' zid='" + owner.ZimbraId + "'/>" + "</CreateMountpointRequest>"); FolderMountpointItem mountpoint = FolderMountpointItem.importFromSOAP(app.zGetActiveAccount(), mountpointname); // -- GUI // Login to load the rights app.zPageLogin.zNavigateTo(); this.startingPage.zNavigateTo(); try { // Click on the mountpoint app.zTreeMail.zTreeItem(Action.A_LEFTCLICK, mountpoint); // Select the item app.zPageMail.zListItem(Action.A_LEFTCLICK, subject); // Reply the item FormMailNew mailform = (FormMailNew) app.zPageMail.zToolbarPressButton(Button.B_FORWARD); mailform.zFillField(FormMailNew.Field.To, ZimbraAccount.AccountA().EmailAddress); mailform.zFillField(Field.From, owner.EmailAddress); mailform.zSubmit(); } finally { // Select the inbox app.zTreeMail.zTreeItem( Action.A_LEFTCLICK, FolderItem.importFromSOAP(app.zGetActiveAccount(), FolderItem.SystemFolder.Inbox)); } // -- VERIFICATION // From the receiving end, verify the message details // Need 'in:inbox' to separate the message from the sent message MailItem sent = MailItem.importFromSOAP(app.zGetActiveAccount(), "in:sent subject:(" + subject + ")"); ZAssert.assertEquals( sent.dToRecipients.size(), 1, "Verify the message is sent to 1 'to' recipient"); ZAssert.assertEquals( sent.dToRecipients.get(0).dEmailAddress, ZimbraAccount.AccountA().EmailAddress, "Verify the 'To' field is correct"); ZAssert.assertEquals( sent.dFromRecipient.dEmailAddress, owner.EmailAddress, "Verify the 'From' field is correct"); ZAssert.assertEquals( sent.dSenderRecipient.dEmailAddress, app.zGetActiveAccount().EmailAddress, "Verify the 'Sender' field is correct"); }
@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>"); }
@Bugs(ids = "62137") @Test( description = "Bug 62137 - 'http://<server>?app=calendar' broken with/without login to zcs", groups = {"functional"}) public void Bug62137_01() throws HarnessException { // Creating object for appointment data String tz, apptSubject, apptBody, apptAttendee; tz = ZTimeZone.TimeZoneEST.getID(); apptSubject = ZimbraSeleniumProperties.getUniqueString(); apptBody = ZimbraSeleniumProperties.getUniqueString(); apptAttendee = 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' 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='" + apptAttendee + "' d='2'/>" + "</inv>" + "<mp content-type='text/plain'>" + "<content>" + apptBody + "</content>" + "</mp>" + "<su>" + apptSubject + "</su>" + "</m>" + "</CreateAppointmentRequest>"); // Reload the application, with app=calendar query parameter ZimbraURI uri = new ZimbraURI(ZimbraURI.getBaseURI()); uri.addQuery("app", "calendar"); app.zPageCalendar.sOpen(uri.toString()); // Verify the page becomes active app.zPageMain.zWaitForActive(); app.zPageCalendar.zWaitForActive(); ZAssert.assertTrue(app.zPageCalendar.zIsActive(), "Verify the page becomes active"); // Verify the appointment appears in the view boolean found = false; List<AppointmentItem> items = app.zPageCalendar.zListGetAppointments(); for (AppointmentItem item : items) { if (apptSubject.equals(item.getSubject())) { found = true; break; } } ZAssert.assertTrue(found, "Verify appt gets displayed in work week view"); }
@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(); } }
@Bugs(ids = "79188") @Test( description = "Delete a conversation - 1 message in inbox, 1 message in draft", groups = {"functional"}) public void DeleteConversation_11() throws HarnessException { // -- DATA String subject = "subject" + ZimbraSeleniumProperties.getUniqueString(); // Create a conversation (1 message in inbox, 1 draft response) ZimbraAccount.AccountA() .soapSend( "<SendMsgRequest xmlns='urn:zimbraMail'>" + "<m>" + "<e t='t' a='" + app.zGetActiveAccount().EmailAddress + "'/>" + "<su>" + subject + "</su>" + "<mp ct='text/plain'>" + "<content>body " + ZimbraSeleniumProperties.getUniqueString() + "</content>" + "</mp>" + "</m>" + "</SendMsgRequest>"); MailItem message1 = MailItem.importFromSOAP(app.zGetActiveAccount(), "subject:(" + subject + ")"); app.zGetActiveAccount() .soapSend( "<SaveDraftRequest xmlns='urn:zimbraMail'>" + "<m origid='" + message1.getId() + "' rt='r'>" + "<e t='t' a='" + ZimbraAccount.AccountA().EmailAddress + "'/>" + "<su>RE: " + subject + "</su>" + "<mp ct='text/plain'>" + "<content>body " + ZimbraSeleniumProperties.getUniqueString() + "</content>" + "</mp>" + "</m>" + "</SaveDraftRequest>"); // Get the system folders FolderItem inbox = FolderItem.importFromSOAP(app.zGetActiveAccount(), SystemFolder.Inbox); FolderItem drafts = FolderItem.importFromSOAP(app.zGetActiveAccount(), SystemFolder.Drafts); FolderItem trash = FolderItem.importFromSOAP(app.zGetActiveAccount(), SystemFolder.Trash); // -- GUI // Click Get Mail button app.zPageMail.zToolbarPressButton(Button.B_GETMAIL); // Click in Drafts app.zTreeMail.zTreeItem(Action.A_LEFTCLICK, drafts); // Select the conversation or message (in 8.X, only messages are shown in drafts, not // conversations) app.zPageMail.zListItem(Action.A_LEFTCLICK, subject); // Click Delete app.zPageMail.zToolbarPressButton(Button.B_DELETE); // -- Verification // Verify inbox message remains (bug 79188) MailItem m = MailItem.importFromSOAP( app.zGetActiveAccount(), "subject:(" + subject + ") inid:" + inbox.getId()); ZAssert.assertNotNull(m, "Verify original message reamins in the inbox"); // Verify draft is no longer in drafts folder m = MailItem.importFromSOAP( app.zGetActiveAccount(), "subject:(" + subject + ") inid:" + drafts.getId()); ZAssert.assertNull(m, "Verify message is deleted from drafts"); // Verify draft is in trash folder m = MailItem.importFromSOAP( app.zGetActiveAccount(), "subject:(" + subject + ") inid:" + trash.getId()); ZAssert.assertNotNull(m, "Verify message is moved to trash"); }
@Test( description = "Mark all messages as read in folder (context menu)", groups = {"functional"}) public void MarkAllAsReadMountpoint_01() throws HarnessException { String foldername = "folder" + ZimbraSeleniumProperties.getUniqueString(); String subject = "subject" + ZimbraSeleniumProperties.getUniqueString(); String mountpointname = "mountpoint" + ZimbraSeleniumProperties.getUniqueString(); FolderItem inbox = FolderItem.importFromSOAP(ZimbraAccount.AccountA(), FolderItem.SystemFolder.Inbox); // Create a folder to share ZimbraAccount.AccountA() .soapSend( "<CreateFolderRequest xmlns='urn:zimbraMail'>" + "<folder name='" + foldername + "' l='" + inbox.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='rwidxa'/>" + "</action>" + "</FolderActionRequest>"); // Add a message to it ZimbraAccount.AccountA() .soapSend( "<AddMsgRequest xmlns='urn:zimbraMail'>" + "<m l='" + folder.getId() + "' f='u'>" + "<content>From: [email protected]\n" + "To: [email protected] \n" + "Subject: " + subject + "\n" + "MIME-Version: 1.0 \n" + "Content-Type: text/plain; charset=utf-8 \n" + "Content-Transfer-Encoding: 7bit\n" + "\n" + "simple text string in the body\n" + "</content>" + "</m>" + "</AddMsgRequest>"); // Mount it app.zGetActiveAccount() .soapSend( "<CreateMountpointRequest xmlns='urn:zimbraMail'>" + "<link l='1' name='" + mountpointname + "' rid='" + folder.getId() + "' zid='" + ZimbraAccount.AccountA().ZimbraId + "'/>" + "</CreateMountpointRequest>"); FolderMountpointItem mountpoint = FolderMountpointItem.importFromSOAP(app.zGetActiveAccount(), mountpointname); // Click Get Mail button app.zPageMail.zToolbarPressButton(Button.B_GETMAIL); // Right click on folder, select "Mark all as read" app.zTreeMail.zTreeItem(Action.A_RIGHTCLICK, Button.B_TREE_FOLDER_MARKASREAD, mountpoint); // Make sure the folder was created on the server MailItem mail = MailItem.importFromSOAP(ZimbraAccount.AccountA(), "subject:(" + subject + ")"); ZAssert.assertNotNull(mail, "Verify the message exists"); ZAssert.assertStringDoesNotContain( mail.getFlags(), "u", "Verify the mail flags does not contain (u)nread"); }
@Test( description = "Verify Permission Denied on Spam a shared mail (read-only share)", groups = {"functional"}) public void MarkSpamMessage_01() throws HarnessException { String foldername = "folder" + ZimbraSeleniumProperties.getUniqueString(); String subject = "subject" + ZimbraSeleniumProperties.getUniqueString(); String mountpointname = "mountpoint" + ZimbraSeleniumProperties.getUniqueString(); FolderItem inbox = FolderItem.importFromSOAP(ZimbraAccount.AccountA(), FolderItem.SystemFolder.Inbox); // Create a folder to share ZimbraAccount.AccountA() .soapSend( "<CreateFolderRequest xmlns='urn:zimbraMail'>" + "<folder name='" + foldername + "' l='" + inbox.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'/>" + "</action>" + "</FolderActionRequest>"); // Add a message to it ZimbraAccount.AccountA() .soapSend( "<AddMsgRequest xmlns='urn:zimbraMail'>" + "<m l='" + folder.getId() + "' >" + "<content>From: [email protected]\n" + "To: [email protected] \n" + "Subject: " + subject + "\n" + "MIME-Version: 1.0 \n" + "Content-Type: text/plain; charset=utf-8 \n" + "Content-Transfer-Encoding: 7bit\n" + "\n" + "simple text string in the body\n" + "</content>" + "</m>" + "</AddMsgRequest>"); MailItem mail = MailItem.importFromSOAP(ZimbraAccount.AccountA(), "subject:(" + subject + ")"); // Mount it app.zGetActiveAccount() .soapSend( "<CreateMountpointRequest xmlns='urn:zimbraMail'>" + "<link l='1' name='" + mountpointname + "' rid='" + folder.getId() + "' zid='" + ZimbraAccount.AccountA().ZimbraId + "'/>" + "</CreateMountpointRequest>"); FolderMountpointItem mountpoint = FolderMountpointItem.importFromSOAP(app.zGetActiveAccount(), mountpointname); // Click Get Mail button app.zPageMail.zToolbarPressButton(Button.B_GETMAIL); // Click on the mountpoint app.zTreeMail.zTreeItem(Action.A_LEFTCLICK, mountpoint); // Select the item app.zPageMail.zListItem(Action.A_LEFTCLICK, mail.dSubject); // Verify that the toolbar button is disabled String locator = "css=div[id='ztb__TV-main'] div[id='zb__TV-main__SPAM']"; ZAssert.assertTrue( app.zPageMail.sIsElementPresent(locator), "Verify the spam button is present"); ZAssert.assertTrue( app.zPageMail.sIsElementPresent(locator + "[class*='ZDisabled']"), "Verify the spam button is disabled"); }
@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"); }