@Test( description = "Rename a folder - set to an invalid name with ':'", groups = {"functional"}) public void RenameFolder_02() 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:folder" + ZimbraSeleniumProperties.getUniqueString(); dialog.zSetNewName(name2); dialog.zClickButton(Button.B_OK); DialogError error = app.zPageMain.zGetErrorDialog(DialogErrorID.InvalidFolderName); ZAssert.assertTrue(error.zIsActive(), "Verify the error dialog appears"); error.zClickButton(Button.B_OK); }
@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"); }