@Test( description = "Delete a task by selecting and typing 'delete' keyboard-Verify Toast message through GUI", groups = {"smoke"}, dataProvider = "DataProviderDeleteKeys") public void DeleteTaskToastMsg_03(String name, int keyEvent) throws HarnessException { FolderItem taskFolder = FolderItem.importFromSOAP(app.zGetActiveAccount(), SystemFolder.Tasks); // Create a basic task to delete String subject = "task" + ZimbraSeleniumProperties.getUniqueString(); app.zGetActiveAccount() .soapSend( "<CreateTaskRequest xmlns='urn:zimbraMail'>" + "<m >" + "<inv>" + "<comp name='" + subject + "'>" + "<or a='" + app.zGetActiveAccount().EmailAddress + "'/>" + "</comp>" + "</inv>" + "<su>" + subject + "</su>" + "<mp ct='text/plain'>" + "<content>content" + ZimbraSeleniumProperties.getUniqueString() + "</content>" + "</mp>" + "</m>" + "</CreateTaskRequest>"); GeneralUtility.syncDesktopToZcsWithSoap(app.zGetActiveAccount()); TaskItem task = TaskItem.importFromSOAP(app.zGetActiveAccount(), subject); ZAssert.assertNotNull(task, "Verify the task is created"); // Refresh the tasks view app.zPageTasks.zToolbarPressButton(Button.B_REFRESH); app.zTreeTasks.zTreeItem(Action.A_LEFTCLICK, taskFolder); // Select the item app.zPageTasks.zListItem(Action.A_MAIL_CHECKBOX, subject); // Click delete keyboard logger.info("Typing shortcut key " + name + " KeyEvent: " + keyEvent); app.zPageMail.zKeyboardKeyEvent(keyEvent); // Verifying the toaster message Toaster toast = app.zPageMain.zGetToaster(); String toastMsg = toast.zGetToastMessage(); ZAssert.assertStringContains( toastMsg, "1 task moved to Trash", "Verify toast message: Task Moved To trash"); }
@Test( description = "Create task through SOAP - delete using Backspace Key & verify Toast message through GUI", groups = {"functional"}) public void DeleteTaskToastMsg_07() throws HarnessException { FolderItem taskFolder = FolderItem.importFromSOAP(app.zGetActiveAccount(), SystemFolder.Tasks); // Create a basic task to delete String subject = "task" + ZimbraSeleniumProperties.getUniqueString(); app.zGetActiveAccount() .soapSend( "<CreateTaskRequest xmlns='urn:zimbraMail'>" + "<m >" + "<inv>" + "<comp name='" + subject + "'>" + "<or a='" + app.zGetActiveAccount().EmailAddress + "'/>" + "</comp>" + "</inv>" + "<su>" + subject + "</su>" + "<mp ct='text/plain'>" + "<content>content" + ZimbraSeleniumProperties.getUniqueString() + "</content>" + "</mp>" + "</m>" + "</CreateTaskRequest>"); GeneralUtility.syncDesktopToZcsWithSoap(app.zGetActiveAccount()); TaskItem task = TaskItem.importFromSOAP(app.zGetActiveAccount(), subject); ZAssert.assertNotNull(task, "Verify the task is created"); // Refresh the tasks view app.zPageTasks.zToolbarPressButton(Button.B_REFRESH); app.zTreeTasks.zTreeItem(Action.A_LEFTCLICK, taskFolder); // Select the item app.zPageTasks.zListItem(Action.A_MAIL_CHECKBOX, subject); // Use Backspace Keyboard Shortcut app.zPageTasks.zKeyboardShortcut(Shortcut.S_BACKSPACE); // Verifying the toaster message Toaster toast = app.zPageMain.zGetToaster(); String toastMsg = toast.zGetToastMessage(); ZAssert.assertStringContains( toastMsg, "1 task moved to Trash", "Verify toast message: Task Moved to Trash"); }
@Test( description = "Delete multiple tasks (3) by select and toolbar delete : Verify Toast message through GUI", groups = {"functional"}) public void DeleteTaskToastMsg_05() throws HarnessException { FolderItem taskFolder = FolderItem.importFromSOAP(app.zGetActiveAccount(), SystemFolder.Tasks); // Create the message data to be sent String subject1 = "task" + ZimbraSeleniumProperties.getUniqueString(); String subject2 = "task" + ZimbraSeleniumProperties.getUniqueString(); String subject3 = "task" + ZimbraSeleniumProperties.getUniqueString(); app.zGetActiveAccount() .soapSend( "<CreateTaskRequest xmlns='urn:zimbraMail'>" + "<m >" + "<inv>" + "<comp name='" + subject1 + "'>" + "<or a='" + app.zGetActiveAccount().EmailAddress + "'/>" + "</comp>" + "</inv>" + "<su>" + subject1 + "</su>" + "<mp ct='text/plain'>" + "<content>content" + ZimbraSeleniumProperties.getUniqueString() + "</content>" + "</mp>" + "</m>" + "</CreateTaskRequest>"); app.zGetActiveAccount() .soapSend( "<CreateTaskRequest xmlns='urn:zimbraMail'>" + "<m >" + "<inv>" + "<comp name='" + subject2 + "'>" + "<or a='" + app.zGetActiveAccount().EmailAddress + "'/>" + "</comp>" + "</inv>" + "<su>" + subject2 + "</su>" + "<mp ct='text/plain'>" + "<content>content" + ZimbraSeleniumProperties.getUniqueString() + "</content>" + "</mp>" + "</m>" + "</CreateTaskRequest>"); app.zGetActiveAccount() .soapSend( "<CreateTaskRequest xmlns='urn:zimbraMail'>" + "<m >" + "<inv>" + "<comp name='" + subject3 + "'>" + "<or a='" + app.zGetActiveAccount().EmailAddress + "'/>" + "</comp>" + "</inv>" + "<su>" + subject3 + "</su>" + "<mp ct='text/plain'>" + "<content>content" + ZimbraSeleniumProperties.getUniqueString() + "</content>" + "</mp>" + "</m>" + "</CreateTaskRequest>"); GeneralUtility.syncDesktopToZcsWithSoap(app.zGetActiveAccount()); // Import each message into MailItem objects TaskItem task1 = TaskItem.importFromSOAP(app.zGetActiveAccount(), subject1); ZAssert.assertNotNull(task1, "Verify the task is created"); TaskItem task2 = TaskItem.importFromSOAP(app.zGetActiveAccount(), subject2); ZAssert.assertNotNull(task2, "Verify the task is created"); TaskItem task3 = TaskItem.importFromSOAP(app.zGetActiveAccount(), subject3); ZAssert.assertNotNull(task3, "Verify the task is created"); // Refresh the tasks view app.zPageTasks.zToolbarPressButton(Button.B_REFRESH); app.zTreeTasks.zTreeItem(Action.A_LEFTCLICK, taskFolder); // Select the items app.zPageTasks.zListItem(Action.A_MAIL_CHECKBOX, subject1); app.zPageTasks.zListItem(Action.A_MAIL_CHECKBOX, subject2); app.zPageTasks.zListItem(Action.A_MAIL_CHECKBOX, subject3); // Click toolbar delete button app.zPageTasks.zToolbarPressButton(Button.B_DELETE); // Verifying the toaster message Toaster toast = app.zPageMain.zGetToaster(); String toastMsg = toast.zGetToastMessage(); ZAssert.assertStringContains( toastMsg, "3 tasks moved to Trash", "Verify toast message: N Tasks Moved to Trash"); }