@Test( description = "Delete multiple messages (3) by select and toolbar delete", groups = {"functional"}) public void DeleteConversation_05() throws HarnessException { // Create the message data to be sent ConversationItem c1 = ConversationItem.createConversationItem(app.zGetActiveAccount()); ConversationItem c2 = ConversationItem.createConversationItem(app.zGetActiveAccount()); ConversationItem c3 = ConversationItem.createConversationItem(app.zGetActiveAccount()); // Click Get Mail button app.zPageMail.zToolbarPressButton(Button.B_GETMAIL); // Select all three items app.zPageMail.zListItem(Action.A_MAIL_CHECKBOX, c1.getSubject()); app.zPageMail.zListItem(Action.A_MAIL_CHECKBOX, c2.getSubject()); app.zPageMail.zListItem(Action.A_MAIL_CHECKBOX, c3.getSubject()); // Click toolbar delete button app.zPageMail.zToolbarPressButton(Button.B_DELETE); // -- Verification // Check each message to verify they exist in the trash FolderItem trash = FolderItem.importFromSOAP(app.zGetActiveAccount(), FolderItem.SystemFolder.Trash); ConversationItem actual1 = ConversationItem.importFromSOAP( app.zGetActiveAccount(), "is:anywhere subject:" + c1.getSubject()); for (MailItem m : actual1.getMessageList()) { ZAssert.assertEquals( m.dFolderId, trash.getId(), "Verify the conversation message is in the trash"); } ConversationItem actual2 = ConversationItem.importFromSOAP( app.zGetActiveAccount(), "is:anywhere subject:" + c2.getSubject()); for (MailItem m : actual2.getMessageList()) { ZAssert.assertEquals( m.dFolderId, trash.getId(), "Verify the conversation message is in the trash"); } ConversationItem actual3 = ConversationItem.importFromSOAP( app.zGetActiveAccount(), "is:anywhere subject:" + c3.getSubject()); for (MailItem m : actual3.getMessageList()) { ZAssert.assertEquals( m.dFolderId, trash.getId(), "Verify the conversation message is in the trash"); } }
@Test( description = "Rename a folder - Context menu -> Rename", groups = {"smoke"}) public void RenameFolder_01() throws HarnessException { FolderItem inbox = FolderItem.importFromSOAP(app.zGetActiveAccount(), SystemFolder.Inbox); ZAssert.assertNotNull(inbox, "Verify the inbox is available"); // Create the subfolder String name1 = "folder" + ZimbraSeleniumProperties.getUniqueString(); app.zGetActiveAccount() .soapSend( "<CreateFolderRequest xmlns='urn:zimbraMail'>" + "<folder name='" + name1 + "' l='" + inbox.getId() + "'/>" + "</CreateFolderRequest>"); FolderItem subfolder1 = FolderItem.importFromSOAP(app.zGetActiveAccount(), name1); ZAssert.assertNotNull(subfolder1, "Verify the subfolder is available"); // Click on Get Mail to refresh the folder list app.zPageMail.zToolbarPressButton(Button.B_GETMAIL); // Rename the folder using context menu DialogRenameFolder dialog = (DialogRenameFolder) app.zTreeMail.zTreeItem(Action.A_RIGHTCLICK, Button.B_RENAME, subfolder1); ZAssert.assertNotNull(dialog, "Verify the dialog opened"); // Set the name, click OK String name2 = "folder" + ZimbraSeleniumProperties.getUniqueString(); dialog.zSetNewName(name2); dialog.zClickButton(Button.B_OK); // Get all the folders and verify the new name appears and the old name disappears app.zGetActiveAccount().soapSend("<GetFolderRequest xmlns = 'urn:zimbraMail'/>"); Element[] eFolder1 = app.zGetActiveAccount().soapSelectNodes("//mail:folder[@name='" + name1 + "']"); ZAssert.assertEquals(eFolder1.length, 0, "Verify the old folder name no longer exists"); Element[] eFolder2 = app.zGetActiveAccount().soapSelectNodes("//mail:folder[@name='" + name2 + "']"); ZAssert.assertEquals(eFolder2.length, 1, "Verify the new folder name exists"); }
@Test( description = "Delete a conversation by selecting and typing '.t' shortcut", groups = {"functional"}) public void DeleteConversation_04() throws HarnessException { // Create the message data to be sent ConversationItem c = ConversationItem.createConversationItem(app.zGetActiveAccount()); // Click Get Mail button app.zPageMail.zToolbarPressButton(Button.B_GETMAIL); // Check the item app.zPageMail.zListItem(Action.A_LEFTCLICK, c.getSubject()); // Click delete app.zPageMail.zKeyboardShortcut(Shortcut.S_MAIL_MOVETOTRASH); // -- Verification // Check each message to verify they exist in the trash FolderItem trash = FolderItem.importFromSOAP(app.zGetActiveAccount(), FolderItem.SystemFolder.Trash); ConversationItem actual = ConversationItem.importFromSOAP( app.zGetActiveAccount(), "is:anywhere subject:" + c.getSubject()); for (MailItem m : actual.getMessageList()) { ZAssert.assertEquals( m.dFolderId, trash.getId(), "Verify the conversation message is in the trash"); } }
private void TagGroup(DialogTag dialogTag, ContactGroupItem group) throws HarnessException { String tagName = "tag" + ZimbraSeleniumProperties.getUniqueString(); dialogTag.zSetTagName(tagName); dialogTag.zClickButton(Button.B_OK); // Make sure the tag was created on the server (get the tag ID) app.zGetActiveAccount().soapSend("<GetTagRequest xmlns='urn:zimbraMail'/>"); ; String tagID = app.zGetActiveAccount() .soapSelectValue("//mail:GetTagResponse//mail:tag[@name='" + tagName + "']", "id"); // Make sure the tag was applied to the contact app.zGetActiveAccount() .soapSend( "<GetContactsRequest xmlns='urn:zimbraMail'>" + "<cn id='" + group.getId() + "'/>" + "</GetContactsRequest>"); String contactTags = app.zGetActiveAccount().soapSelectValue("//mail:GetContactsResponse//mail:cn", "t"); ZAssert.assertEquals( contactTags, tagID, "Verify the tag appears on the contact id=" + group.getId()); // verify toasted message '1 contact tagged ...' String expectedMsg = "1 contact group tagged \"" + tagName + "\""; ZAssert.assertStringContains( app.zPageMain.zGetToaster().zGetToastMessage(), expectedMsg, "Verify toast message '" + expectedMsg + "'"); }
@Test( description = "Delete a mail using context menu delete button", groups = {"functional"}) public void DeleteConversation_06() throws HarnessException { // Create the message data to be sent ConversationItem c = ConversationItem.createConversationItem(app.zGetActiveAccount()); // 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 // Check each message to verify they exist in the trash FolderItem trash = FolderItem.importFromSOAP(app.zGetActiveAccount(), FolderItem.SystemFolder.Trash); ConversationItem actual = ConversationItem.importFromSOAP( app.zGetActiveAccount(), "is:anywhere subject:" + c.getSubject()); for (MailItem m : actual.getMessageList()) { ZAssert.assertEquals( m.dFolderId, trash.getId(), "Verify the conversation message is in the trash"); } }
@Bugs(ids = "53564") @Test( description = "Hard-delete a mail by selecting and typing 'shift-del' shortcut", groups = {"functional"}) public void HardDeleteConversation_01() throws HarnessException { // Create the message data to be sent ConversationItem c = ConversationItem.createConversationItem(app.zGetActiveAccount()); // Click Get Mail button app.zPageMail.zToolbarPressButton(Button.B_GETMAIL); // Check the item app.zPageMail.zListItem(Action.A_LEFTCLICK, c.getSubject()); // Click shift-delete DialogWarning dialog = (DialogWarning) app.zPageMail.zKeyboardShortcut(Shortcut.S_MAIL_HARDELETE); dialog.zClickButton(Button.B_OK); // Verify the message is no longer in the mailbox app.zGetActiveAccount() .soapSend( "<SearchRequest xmlns='urn:zimbraMail' types='conversation'>" + "<query>subject:(" + c.getSubject() + ") is:anywhere</query>" + "</SearchRequest>"); Element[] nodes = app.zGetActiveAccount().soapSelectNodes("//mail:c"); ZAssert.assertEquals(nodes.length, 0, "Verify the converastion is no longer in the mailbox"); }
@Test( description = "Create a new tasklist using tasks app New -> New Task Folder", groups = {"functional"}) public void CreateTaskFolder_02() throws HarnessException { ZimbraAccount account = app.zGetActiveAccount(); FolderItem taskFolder = FolderItem.importFromSOAP(account, SystemFolder.Tasks); _folderName = "taskfolder" + ZimbraSeleniumProperties.getUniqueString(); // Create folder DialogCreateTaskFolder createTaskFolderDialog = (DialogCreateTaskFolder) app.zPageTasks.zToolbarPressPulldown(Button.B_NEW, Button.O_NEW_TASKFOLDER); createTaskFolderDialog.zEnterFolderName(_folderName); createTaskFolderDialog.zClickButton(Button.B_OK); _folderIsCreated = true; SleepUtil.sleepVerySmall(); // refresh task page app.zTreeTasks.zTreeItem(Action.A_LEFTCLICK, taskFolder); // Make sure the task folder was created on the ZCS server FolderItem folder = FolderItem.importFromSOAP(app.zGetActiveAccount(), _folderName); ZAssert.assertNotNull(folder, "Verify task folder is created"); ZAssert.assertEquals( folder.getName(), _folderName, "Verify the server and client folder names match"); }
@Test( description = "Create a new tasklist by clicking 'Create a new task' on task folders tree", groups = {"sanity"}) public void CreateTaskFolder_01() throws HarnessException { ZimbraAccount account = app.zGetActiveAccount(); FolderItem taskFolder = FolderItem.importFromSOAP(account, SystemFolder.Tasks); _folderName = "taskfolder" + ZimbraSeleniumProperties.getUniqueString(); // Create folder // DialogCreateTaskFolder createTaskFolderDialog // =(DialogCreateTaskFolder)app.zTreeTasks.zPressButton(Button.B_TREE_NEWTASKLIST); DialogCreateTaskFolder createTaskFolderDialog = (DialogCreateTaskFolder) app.zTreeTasks.zPressPulldown(Button.B_TREE_FOLDERS_OPTIONS, Button.B_TREE_NEWTASKLIST); createTaskFolderDialog.zEnterFolderName(_folderName); createTaskFolderDialog.zClickButton(Button.B_OK); _folderIsCreated = true; SleepUtil.sleepVerySmall(); // refresh task page app.zTreeTasks.zTreeItem(Action.A_LEFTCLICK, taskFolder); // Make sure the task folder was created on the ZCS server FolderItem folder = FolderItem.importFromSOAP(app.zGetActiveAccount(), _folderName); ZAssert.assertNotNull(folder, "Verify task folder is created"); ZAssert.assertEquals( folder.getName(), _folderName, "Verify the server and client folder names match"); }
@Test( description = "Delete a conversation by selecting and typing 'delete' keyboard", groups = {"functional"}, dataProvider = "DataProviderDeleteKeys") public void DeleteConversation_03(String name, int keyEvent) throws HarnessException { // Create the message data to be sent ConversationItem c = ConversationItem.createConversationItem(app.zGetActiveAccount()); // Click Get Mail button app.zPageMail.zToolbarPressButton(Button.B_GETMAIL); // Check the item app.zPageMail.zListItem(Action.A_LEFTCLICK, c.getSubject()); // Click delete logger.info("Typing shortcut key " + name + " KeyEvent: " + keyEvent); app.zPageMail.zKeyboardKeyEvent(keyEvent); // -- Verification // Check each message to verify they exist in the trash FolderItem trash = FolderItem.importFromSOAP(app.zGetActiveAccount(), FolderItem.SystemFolder.Trash); ConversationItem actual = ConversationItem.importFromSOAP( app.zGetActiveAccount(), "is:anywhere subject:" + c.getSubject()); for (MailItem m : actual.getMessageList()) { ZAssert.assertEquals( m.dFolderId, trash.getId(), "Verify the conversation message is in the trash"); } }
@Test( description = "Edit a folder, change the color (Context menu -> Edit)", groups = {"functional"}) public void ChangeColorOfSystemFolders() throws HarnessException { // -- Data FolderItem contacts = FolderItem.importFromSOAP(app.zGetActiveAccount(), SystemFolder.Contacts); // -- GUI // Refresh app.zPageAddressbook.zRefresh(); // Change the folder's color using context menu DialogEditFolder dialog = (DialogEditFolder) app.zTreeContacts.zTreeItem(Action.A_RIGHTCLICK, Button.B_TREE_EDIT, contacts); ZAssert.assertNotNull(dialog, "Verify the dialog opened"); dialog.zSetNewColor(FolderColor.Green); dialog.zClickButton(Button.B_OK); // -- Verification // Get the folder again FolderItem actual = FolderItem.importFromSOAP(app.zGetActiveAccount(), contacts.getName()); ZAssert.assertEquals( actual.getColor(), "3", "Verify the color of the folder is set to green (3)"); }
@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 = "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 = "Edit a subfolder, change name and color Context menu -> Edit)", groups = {"functional"}) public void ChangeNameColorOfSubFolder() throws HarnessException { // -- Data FolderItem contacts = FolderItem.importFromSOAP(app.zGetActiveAccount(), SystemFolder.Contacts); // Create a folder String name = "ab" + ZimbraSeleniumProperties.getUniqueString(); String newname = "ab" + ZimbraSeleniumProperties.getUniqueString(); app.zGetActiveAccount() .soapSend( "<CreateFolderRequest xmlns='urn:zimbraMail'>" + "<folder name='" + name + "' view='contact' l='" + contacts.getId() + "'/>" + "</CreateFolderRequest>"); FolderItem folderItem = FolderItem.importFromSOAP(app.zGetActiveAccount(), name); // -- GUI // Refresh app.zPageAddressbook.zRefresh(); // Change the folder's color using context menu DialogEditFolder dialog = (DialogEditFolder) app.zTreeContacts.zTreeItem(Action.A_RIGHTCLICK, Button.B_TREE_EDIT, folderItem); ZAssert.assertNotNull(dialog, "Verify the dialog opened"); dialog.zSetNewColor(FolderColor.Orange); dialog.zSetNewName(newname); dialog.zClickButton(Button.B_OK); // -- Verification // Get the folder again FolderItem actual = FolderItem.importFromSOAP(app.zGetActiveAccount(), name); ZAssert.assertNull(actual, "Verify the old addressbook does not exist"); actual = FolderItem.importFromSOAP(app.zGetActiveAccount(), newname); ZAssert.assertNotNull(actual, "Verify the new addressbook exists"); ZAssert.assertEquals( actual.getColor(), "9", "Verify the color of the folder is set to orange (9)"); }
@Test( description = "Delete a a top level briefcase folder - Right click, Delete", groups = {"smoke"}) public void DeleteFolder_02() throws HarnessException { ZimbraAccount account = app.zGetActiveAccount(); FolderItem briefcaseRootFolder = FolderItem.importFromSOAP(account, SystemFolder.Briefcase); FolderItem userRootFolder = FolderItem.importFromSOAP(account, SystemFolder.UserRoot); ZAssert.assertNotNull(userRootFolder, "Verify the user root folder is available"); FolderItem trash = FolderItem.importFromSOAP(app.zGetActiveAccount(), SystemFolder.Trash); ZAssert.assertNotNull(trash, "Verify the trash is available"); // Create a top level briefcase folder String briefcaseTopLevelFolderName = "folder" + ZimbraSeleniumProperties.getUniqueString(); account.soapSend( "<CreateFolderRequest xmlns='urn:zimbraMail'>" + "<folder name='" + briefcaseTopLevelFolderName + "' l='" + userRootFolder.getId() + "' view='document'/>" + "</CreateFolderRequest>"); FolderItem briefcaseTopLevelFolder = FolderItem.importFromSOAP(account, briefcaseTopLevelFolderName); ZAssert.assertNotNull( briefcaseTopLevelFolder, "Verify the briefcase top level folder is available"); // refresh the Briefcase tree folder list app.zTreeBriefcase.zTreeItem(Action.A_LEFTCLICK, briefcaseRootFolder, false); // Delete the folder using context menu app.zTreeBriefcase.zTreeItem( Action.A_RIGHTCLICK, Button.B_TREE_DELETE, briefcaseTopLevelFolder); // Verify the folder is now in the trash briefcaseTopLevelFolder = FolderItem.importFromSOAP(app.zGetActiveAccount(), briefcaseTopLevelFolderName); ZAssert.assertNotNull( briefcaseTopLevelFolder, "Verify the briefcase top level folder is again available"); ZAssert.assertEquals( trash.getId(), briefcaseTopLevelFolder.getParentId(), "Verify the deleted briefcase top level folder's parent is now the trash folder ID"); }
@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"); }
// verify contact tagged with tag and toasted message private void Verify(ContactItem contactItem, String tagName) throws HarnessException { // Make sure the tag was created on the server (get the tag ID) app.zGetActiveAccount().soapSend("<GetTagRequest xmlns='urn:zimbraMail'/>"); ; String tagID = app.zGetActiveAccount() .soapSelectValue("//mail:GetTagResponse//mail:tag[@name='" + tagName + "']", "id"); // Make sure the tag was applied to the contact app.zGetActiveAccount() .soapSend( "<GetContactsRequest xmlns='urn:zimbraMail'>" + "<cn id='" + contactItem.getId() + "'/>" + "</GetContactsRequest>"); String contactTags = app.zGetActiveAccount().soapSelectValue("//mail:GetContactsResponse//mail:cn", "t"); // if multi-tagged if (contactTags.contains(",")) { ZAssert.assertStringContains( contactTags, tagID, "Verify the tag appears on the contact id=" + contactItem.getId()); } else { ZAssert.assertEquals( contactTags, tagID, "Verify the tag appears on the contact id=" + contactItem.getId()); } // verify toasted message '1 contact tagged ...' Toaster toast = app.zPageMain.zGetToaster(); String toastMsg = toast.zGetToastMessage(); ZAssert.assertStringContains( toastMsg, "1 contact tagged \"" + tagName + "\"", "Verify toast message '" + "1 contact tagged \"" + tagName + "\"'"); }
@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 = "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"); }
@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'"); }
@Test( description = "Undo - Mark a message as spam, using 'Spam' toolbar button", groups = {"functional"}) public void UndoMarkSpamMessage_01() throws HarnessException { FolderItem inbox = FolderItem.importFromSOAP(app.zGetActiveAccount(), FolderItem.SystemFolder.Inbox); FolderItem junk = FolderItem.importFromSOAP(app.zGetActiveAccount(), FolderItem.SystemFolder.Junk); String subject = "subject" + ZimbraSeleniumProperties.getUniqueString(); app.zGetActiveAccount() .soapSend( "<AddMsgRequest xmlns='urn:zimbraMail'>" + "<m l='" + inbox.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" + "content \n" + "\n" + "\n" + "</content>" + "</m>" + "</AddMsgRequest>"); MailItem message = MailItem.importFromSOAP(app.zGetActiveAccount(), "subject:(" + subject + ") is:anywhere"); ZAssert.assertNotNull(message, "Verify the message was created"); // Click Get Mail button app.zPageMail.zToolbarPressButton(Button.B_GETMAIL); // Select the item app.zPageMail.zListItem(Action.A_LEFTCLICK, subject); // Click spam app.zPageMail.zToolbarPressButton(Button.B_RESPORTSPAM); // Get the mail item for the new message // Need 'is:anywhere' to include the spam folder MailItem spam = MailItem.importFromSOAP(app.zGetActiveAccount(), "is:anywhere subject:(" + subject + ")"); ZAssert.assertEquals(spam.dFolderId, junk.getId(), "Verify the message is in the spam folder"); // Click undo Toaster toaster = app.zPageMain.zGetToaster(); toaster.zClickUndo(); // Get the mail item for the new message // Need 'is:anywhere' to include the spam folder MailItem undone = MailItem.importFromSOAP(app.zGetActiveAccount(), "is:anywhere subject:(" + subject + ")"); ZAssert.assertEquals( undone.dFolderId, inbox.getId(), "Verify the message is back in the inbox folder"); }
@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"); } } }
@Bugs(ids = "69132") @Test( description = "Delete instance of series appointment (every week) using keyboard shortcuts Del & Backspace", groups = {"functional"}, dataProvider = "DataProviderShortcutKeys") public void DeleteInstance_06(String name, int keyEvent) throws HarnessException { // -- Data Setup // Appointment data String tz, apptSubject, apptBody; tz = ZTimeZone.TimeZoneEST.getID(); apptSubject = "subject" + ZimbraSeleniumProperties.getUniqueString(); apptBody = "body" + ZimbraSeleniumProperties.getUniqueString(); // Absolute dates in UTC zone Calendar now = this.calendarWeekDayUTC; ZDate startTime = new ZDate( now.get(Calendar.YEAR), now.get(Calendar.MONTH) + 1, now.get(Calendar.DAY_OF_MONTH), 12, 0, 0); ZDate endTime = 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='" + startTime.toTimeZone(tz).toYYYYMMDDTHHMMSS() + "' tz='" + tz + "'/>" + "<e d='" + endTime.toTimeZone(tz).toYYYYMMDDTHHMMSS() + "' tz='" + tz + "'/>" + "<or a='" + app.zGetActiveAccount().EmailAddress + "'/>" + "<recur>" + "<add>" + "<rule freq='MON'>" + "<interval ival='1'/>" + "</rule>" + "</add>" + "</recur>" + "</inv>" + "<mp content-type='text/plain'>" + "<content>" + apptBody + "</content>" + "</mp>" + "<su>" + apptSubject + "</su>" + "</m>" + "</CreateAppointmentRequest>"); // -- GUI actions // Delete instance and verify corresponding UI app.zPageCalendar.zToolbarPressButton(Button.B_REFRESH); app.zPageCalendar.zListItem(Action.A_LEFTCLICK, apptSubject); DialogWarning dialogSeriesOrInstance = (DialogWarning) app.zPageCalendar.zKeyboardKeyEvent(keyEvent); dialogSeriesOrInstance.zClickButton(Button.B_DELETE_THIS_INSTANCE); DialogWarning confirmDelete = (DialogWarning) dialogSeriesOrInstance.zClickButton(Button.B_OK); confirmDelete.zClickButton(Button.B_YES); // -- Verification // On the server, verify the appointment is in the trash app.zGetActiveAccount() .soapSend( "<SearchRequest xmlns='urn:zimbraMail' types='appointment' calExpandInstStart='" + startTime.addDays(-7).toMillis() + "' calExpandInstEnd='" + endTime.addDays(7).toMillis() + "'>" + "<query>is:anywhere " + apptSubject + "</query>" + "</SearchRequest>"); // http://bugzilla.zimbra.com/show_bug.cgi?id=63412 - "Deleting instance from calendar series // does not allow for user restoration from the Trash can" // http://bugzilla.zimbra.com/show_bug.cgi?id=13527#c4 - "Moving an instance from one cal to // other, moves complete series" // For now, nothing should be returned in the SearchResponse // // String folderID = app.zGetActiveAccount().soapSelectValue("//mail:appt", "l"); // ZAssert.assertEquals( // folderID, // FolderItem.importFromSOAP(app.zGetActiveAccount(), SystemFolder.Trash).getId(), // "Verify appointment is in the trash folder"); Element[] appts = app.zGetActiveAccount().soapSelectNodes("//mail:appt"); ZAssert.assertEquals( appts.length, 0, "Verify the appt element does not exist ... See also bug 63412"); // Verify the appointment is not in the GUI view // ZAssert.assertEquals(app.zPageCalendar.sIsElementPresent(app.zPageCalendar.zGetApptLocator(apptSubject)), false, "Verify instance is deleted from the calendar"); boolean deleted = app.zPageCalendar.zWaitForElementDeleted( app.zPageCalendar.zGetApptLocator(apptSubject), "10000"); ZAssert.assertEquals(deleted, true, "Verify instance is deleted from the calendar"); }
@Bugs(ids = "80287") @Test( description = "Modify a basic retention (Context menu -> Edit -> Retention) (zimbraFeatureSharingEnabled=FALSE)", groups = {"functional"}) public void Bug80287_01() throws HarnessException { // -- Data // Create the subfolder String foldername = "folder" + ZimbraSeleniumProperties.getUniqueString(); app.zGetActiveAccount() .soapSend( "<CreateFolderRequest xmlns='urn:zimbraMail'>" + "<folder name='" + foldername + "' l='" + FolderItem.importFromSOAP(app.zGetActiveAccount(), FolderItem.SystemFolder.Inbox) .getId() + "'/>" + "</CreateFolderRequest>"); FolderItem folder = FolderItem.importFromSOAP(app.zGetActiveAccount(), foldername); ZAssert.assertNotNull(folder, "Verify the subfolder is available"); // Add a retention policy app.zGetActiveAccount() .soapSend( "<FolderActionRequest xmlns='urn:zimbraMail'>" + "<action id='" + folder.getId() + "' op='retentionpolicy'>" + "<retentionPolicy>" + "<keep>" + "<policy lifetime='5d' type='user'/>" + "</keep>" + "</retentionPolicy>" + "</action>" + "</FolderActionRequest>"); // -- GUI // Click on Get Mail to refresh the folder list app.zPageMail.zToolbarPressButton(Button.B_GETMAIL); // Rename the folder using context menu DialogEditFolder dialog = (DialogEditFolder) app.zTreeMail.zTreeItem(Action.A_RIGHTCLICK, Button.B_TREE_EDIT, folder); // Set to 4 years dialog.zNavigateToTab(DialogEditFolder.DialogTab.Retention); dialog.zRetentionSetRangeValue(6); // Save dialog.zClickButton(Button.B_OK); // -- Verification // Verify the retention policy on the folder app.zGetActiveAccount() .soapSend( "<GetFolderRequest xmlns='urn:zimbraMail'>" + "<folder l='" + folder.getId() + "'/>" + "</GetFolderRequest>"); String lifetime = app.zGetActiveAccount().soapSelectValue("//mail:keep//mail:policy", "lifetime"); ZAssert.assertEquals(lifetime, "6d", "Verify the policy lifetime is set to 6 days"); }
@Test( description = "Drag one folder and Drop into other", groups = {"smoke"}) public void DragAndDropFeed_01() throws HarnessException, MalformedURLException { FolderItem inbox = FolderItem.importFromSOAP(app.zGetActiveAccount(), SystemFolder.Inbox); ZAssert.assertNotNull(inbox, "Verify the inbox is available"); // Create a subfolder in Inbox String feedname = "feed" + ZimbraSeleniumProperties.getUniqueString(); URL feedurl = new URL("http", "rss.news.yahoo.com", 80, "/rss/topstories"); app.zGetActiveAccount() .soapSend( "<CreateFolderRequest xmlns='urn:zimbraMail'>" + "<folder name='" + feedname + "' l='" + inbox.getId() + "' url='" + feedurl.toString() + "'/>" + "</CreateFolderRequest>"); FolderItem feed = FolderItem.importFromSOAP(app.zGetActiveAccount(), feedname); ZAssert.assertNotNull(feed, "Verify the subfolder is available"); // Create two subfolders in the inbox // One folder to Drag // Another folder to drop into String name1 = "folder" + ZimbraSeleniumProperties.getUniqueString(); app.zGetActiveAccount() .soapSend( "<CreateFolderRequest xmlns='urn:zimbraMail'>" + "<folder name='" + name1 + "' l='" + inbox.getId() + "'/>" + "</CreateFolderRequest>"); FolderItem subfolder1 = FolderItem.importFromSOAP(app.zGetActiveAccount(), name1); ZAssert.assertNotNull(subfolder1, "Verify the first subfolder is available"); // Click on Get Mail to refresh the folder list app.zPageMail.zToolbarPressButton(Button.B_GETMAIL); // Bug 65234 // Sometimes the folder tree is rendered slowly. sleep a bit SleepUtil.sleepVerySmall(); app.zPageMail.zDragAndDrop( "css=td[id='zti__main_Mail__" + feed.getId() + "_textCell']", "css=td[id='zti__main_Mail__" + subfolder1.getId() + "_textCell']"); // Verify the folder is now in the other subfolder feed = FolderItem.importFromSOAP(app.zGetActiveAccount(), feedname); ZAssert.assertNotNull(feed, "Verify the subfolder is again available"); ZAssert.assertEquals( subfolder1.getId(), feed.getParentId(), "Verify the subfolder's parent is now the other subfolder"); }
@Bugs(ids = "69132") @Test( description = "Delete an appointment using Delete toolbar button", groups = {"smoke"}) public void DeleteAppointment_01() throws HarnessException { // Creating objects for appointment data String tz, apptSubject, apptBody; tz = ZTimeZone.TimeZoneEST.getID(); apptSubject = ZimbraSeleniumProperties.getUniqueString(); apptBody = ZimbraSeleniumProperties.getUniqueString(); // Absolute dates in UTC zone Calendar now = this.calendarWeekDayUTC; ZDate startUTC = new ZDate( now.get(Calendar.YEAR), now.get(Calendar.MONTH) + 1, now.get(Calendar.DAY_OF_MONTH), 12, 0, 0); ZDate endUTC = new ZDate( now.get(Calendar.YEAR), now.get(Calendar.MONTH) + 1, now.get(Calendar.DAY_OF_MONTH), 14, 0, 0); app.zGetActiveAccount() .soapSend( "<CreateAppointmentRequest xmlns='urn:zimbraMail'>" + "<m>" + "<inv method='REQUEST' type='event' fb='B' transp='O' allDay='0' name='" + apptSubject + "'>" + "<s d='" + startUTC.toTimeZone(tz).toYYYYMMDDTHHMMSS() + "' tz='" + tz + "'/>" + "<e d='" + endUTC.toTimeZone(tz).toYYYYMMDDTHHMMSS() + "' tz='" + tz + "'/>" + "<or a='" + app.zGetActiveAccount().EmailAddress + "'/>" + "</inv>" + "<mp content-type='text/plain'>" + "<content>" + apptBody + "</content>" + "</mp>" + "<su>" + apptSubject + "</su>" + "</m>" + "</CreateAppointmentRequest>"); // Right click to appointment and delete it app.zPageCalendar.zToolbarPressButton(Button.B_REFRESH); app.zPageCalendar.zListItem(Action.A_LEFTCLICK, apptSubject); DialogConfirmDeleteAppointment dlgConfirm = (DialogConfirmDeleteAppointment) app.zPageCalendar.zToolbarPressButton(Button.B_DELETE); dlgConfirm.zClickButton(Button.B_YES); dlgConfirm.zWaitForClose(); ZAssert.assertEquals( app.zPageCalendar.zIsAppointmentExists(apptSubject), false, "Verify appointment is deleted"); }
@Bugs(ids = "69132") @Test( description = "Delete an appointment using keyboard shortcuts (Del & Backspace)", groups = {"functional"}, dataProvider = "DataProviderShortcutKeys") public void DeleteAppointment_03(String name, int keyEvent) throws HarnessException { // Creating objects for appointment data String tz, apptSubject, apptBody; tz = ZTimeZone.TimeZoneEST.getID(); apptSubject = ZimbraSeleniumProperties.getUniqueString(); apptBody = ZimbraSeleniumProperties.getUniqueString(); // Absolute dates in UTC zone Calendar now = this.calendarWeekDayUTC; ZDate startUTC = new ZDate( now.get(Calendar.YEAR), now.get(Calendar.MONTH) + 1, now.get(Calendar.DAY_OF_MONTH), 12, 0, 0); ZDate endUTC = new ZDate( now.get(Calendar.YEAR), now.get(Calendar.MONTH) + 1, now.get(Calendar.DAY_OF_MONTH), 14, 0, 0); app.zGetActiveAccount() .soapSend( "<CreateAppointmentRequest xmlns='urn:zimbraMail'>" + "<m>" + "<inv method='REQUEST' type='event' fb='B' transp='O' allDay='0' name='" + apptSubject + "'>" + "<s d='" + startUTC.toTimeZone(tz).toYYYYMMDDTHHMMSS() + "' tz='" + tz + "'/>" + "<e d='" + endUTC.toTimeZone(tz).toYYYYMMDDTHHMMSS() + "' tz='" + tz + "'/>" + "<or a='" + app.zGetActiveAccount().EmailAddress + "'/>" + "</inv>" + "<mp content-type='text/plain'>" + "<content>" + apptBody + "</content>" + "</mp>" + "<su>" + apptSubject + "</su>" + "</m>" + "</CreateAppointmentRequest>"); String apptId = app.zGetActiveAccount() .soapSelectValue("//mail:CreateAppointmentResponse//mail:appt", "id"); // Delete appointment using keyboard Del and Backspace key app.zPageCalendar.zToolbarPressButton(Button.B_REFRESH); app.zPageCalendar.zListItem(Action.A_LEFTCLICK, apptSubject); DialogConfirmDeleteAppointment dlgConfirm = (DialogConfirmDeleteAppointment) app.zPageCalendar.zKeyboardKeyEvent(keyEvent); dlgConfirm.zClickButton(Button.B_YES); // -- Verification app.zGetActiveAccount() .soapSend( "<SearchRequest xmlns='urn:zimbraMail' types='appointment' calExpandInstStart='" + startUTC.addDays(-7).toMillis() + "' calExpandInstEnd='" + startUTC.addDays(7).toMillis() + "'>" + "<query>subject:(" + apptSubject + ")</query>" + "</SearchRequest>"); Element[] nodes = app.zGetActiveAccount().soapSelectNodes("//mail:appt"); ZAssert.assertEquals(nodes.length, 0, "Verify appointment is deleted"); }
@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 = "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"); }