@Bugs(ids = "82807") @Test( description = "Hover over an image attachment", dataProvider = "DataProviderMimeWithImageAttachments", groups = {"functional"}) public void HoverOverAttachment_01(String subject, String path) throws HarnessException { // -- DATA final String mimeFile = ZimbraSeleniumProperties.getBaseDirectory() + path; LmtpInject.injectFile(app.zGetActiveAccount().EmailAddress, new File(mimeFile)); // -- GUI // Click on Get Mail to refresh the folder list app.zPageMail.zToolbarPressButton(Button.B_GETMAIL); // Select the message DisplayMail display = (DisplayMail) app.zPageMail.zListItem(Action.A_LEFTCLICK, subject); List<AttachmentItem> attachments = display.zListGetAttachments(); ZAssert.assertEquals(attachments.size(), 1, "Verify the attachment appears"); TooltipImage tooltip = (TooltipImage) display.zListAttachmentItem(Action.A_HOVEROVER, attachments.get(0)); // -- VERIFICATION ZAssert.assertTrue(tooltip.zIsActive(), "Verify the tooltip shows"); ZAssert.assertNotNull(tooltip.zGetField(Field.URL), "Verify the image URL"); }
@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 = "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"); }