@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"); }
@Test( description = "Measure the time to load the Calendar, month view, 100 appointment", groups = {"performance"}) public void ZmCalendarApp_03() throws HarnessException { // What is today? Calendar today = Calendar.getInstance(); // Import 100 appointments using Calendar.ics and REST String filename = ZimbraSeleniumProperties.getBaseDirectory() + "/data/public/ics/calendar05/Calendar.ics"; File file = null; // Modify the ICS in two ways: // 1. Make the current account the organizer // 2. Make the dates equal to this month file = RestUtil.FileUtils.replaceInFile( "*****@*****.**", app.zGetActiveAccount().EmailAddress, new File(filename)); file = RestUtil.FileUtils.replaceInFile( "201111", (new SimpleDateFormat("yyyyMM")).format(today.getTime()), file); RestUtil rest = new RestUtil(); rest.setAuthentication(app.zGetActiveAccount()); rest.setPath("/service/home/~/Calendar"); rest.setQueryParameter("fmt", "ics"); rest.setUploadFile(file); rest.doPost(); // Start the perf token PerfToken token = PerfMetrics.startTimestamp( PerfKey.ZmCalendarApp, "Load the calendar app, month view, 100 appointment"); // Go to calendar // app.zPageCalendar.zNavigateTo(); app.zPageCalendar.zClickAt("css=td[id='zb__App__Calendar_title']", ""); PerfMetrics.waitTimestamp(token); // Wait for the app to load app.zPageCalendar.zWaitForActive(); }
/** * TestCase : Trusted Domain with message view 1.Set domain in Preference/Mail/Trusted Addresses * Verify it through soap(GetPrefsRequest) 2.In message View Inject mail with external image * 3.Verify To,From,Subject through soap 4.Click on same mail 5.Yellow color Warning Msg Info bar * should not present for trusted domain * * @throws HarnessException */ @Test( description = "Verify Display Image link in Trusted doamin for message view", groups = {"smoke"}) public void TrustedDomainMsgView_01() throws HarnessException { final String subject = "TestTrustedAddress"; final String from = "*****@*****.**"; final String to = "*****@*****.**"; final String mimeFolder = ZimbraSeleniumProperties.getBaseDirectory() + "/data/public/mime/ExternalImg.txt"; // Verify domain through soap- GetPrefsRequest String PrefMailTrustedAddr = ZimbraAccount.AccountZWC().getPreference("zimbraPrefMailTrustedSenderList"); ZAssert.assertTrue( PrefMailTrustedAddr.equals("testdoamin.com"), "Verify doamin is present /Pref/TrustedAddr"); // Inject the external image message(s) LmtpInject.injectFile(app.zGetActiveAccount().EmailAddress, new File(mimeFolder)); MailItem mail = MailItem.importFromSOAP(app.zGetActiveAccount(), subject); ZAssert.assertNotNull(mail, "Verify message is received"); ZAssert.assertEquals(from, mail.dFromRecipient.dEmailAddress, "Verify the from matches"); ZAssert.assertEquals(to, mail.dToRecipients.get(0).dEmailAddress, "Verify the to address"); // Click Get Mail button app.zPageMail.zToolbarPressButton(Button.B_GETMAIL); // Select the message so that it shows in the reading pane app.zPageMail.zListItem(Action.A_LEFTCLICK, subject); // DisplayTrustedAddress actual = new DisplayTrustedAddress(app); // Verify Warning info bar with other links ZAssert.assertFalse( app.zPageMail.zHasWDDLinks(), "Verify Warning icon ,Display Image and Domain link does not present"); }
@Test( description = "Verify bug 13911", groups = {"functional"}) public void Bug_13911() throws HarnessException { String subject = "subject13010064065623"; String bodyBeforeImage = "K\u00e6re alle"; String bodyAfterImage = "Problemet best\u00E5r"; String MimeFolder = ZimbraSeleniumProperties.getBaseDirectory() + "/data/private/mime/Bugs/Bug13911"; LmtpInject.injectFile(ZimbraAccount.AccountZWC().EmailAddress, new File(MimeFolder)); // Click Get Mail button app.zPageMail.zToolbarPressButton(Button.B_GETMAIL); // Select the message so that it shows in the reading pane DisplayMail display = (DisplayMail) app.zPageMail.zListItem(Action.A_LEFTCLICK, subject); String body = display.zGetMailProperty(Field.Body); ZAssert.assertStringContains(body, bodyBeforeImage, "Verify the text before the image"); ZAssert.assertStringContains(body, bodyAfterImage, "Verify the text after the image"); }
@Test( description = "Upload file through RestUtil - move & verify through GUI", groups = {"smoke"}) public void MoveFile_01() throws HarnessException { ZimbraAccount account = app.zGetActiveAccount(); FolderItem folderItem = FolderItem.importFromSOAP(account, SystemFolder.Briefcase); String name = "folder" + ZimbraSeleniumProperties.getUniqueString(); // Create a subfolder to move the message into i.e. Briefcase/subfolder String briefcaseFolderId = folderItem.getId(); account.soapSend( "<CreateFolderRequest xmlns='urn:zimbraMail'>" + "<folder name='" + name + "' l='" + briefcaseFolderId + "'/>" + "</CreateFolderRequest>"); FolderItem subFolder = FolderItem.importFromSOAP(account, name); // refresh briefcase page app.zTreeBriefcase.zTreeItem(Action.A_LEFTCLICK, folderItem, true); // Click on created subfolder GeneralUtility.syncDesktopToZcsWithSoap(app.zGetActiveAccount()); app.zPageBriefcase.zWaitForDesktopLoadingSpinner(5000); app.zPageBriefcase.zListItem(Action.A_LEFTCLICK, subFolder); // Create file item String filePath = ZimbraSeleniumProperties.getBaseDirectory() + "/data/public/other/putty.log"; FileItem fileItem = new FileItem(filePath); // Upload file to server through RestUtil String attachmentId = account.uploadFile(filePath); // Save uploaded file to briefcase through SOAP account.soapSend( "<SaveDocumentRequest xmlns='urn:zimbraMail'>" + "<doc l='" + folderItem.getId() + "'>" + "<upload id='" + attachmentId + "'/>" + "</doc>" + "</SaveDocumentRequest>"); // account.soapSelectNode("//mail:SaveDocumentResponse", 1); GeneralUtility.syncDesktopToZcsWithSoap(app.zGetActiveAccount()); app.zPageBriefcase.zWaitForDesktopLoadingSpinner(5000); // refresh briefcase page app.zTreeBriefcase.zTreeItem(Action.A_LEFTCLICK, folderItem, true); // Click on created document app.zPageBriefcase.zListItem(Action.A_LEFTCLICK, fileItem); // Click on Move selected item icon in toolbar DialogMove chooseFolder = (DialogMove) app.zPageBriefcase.zToolbarPressButton(Button.B_MOVE, fileItem); // Click OK on Confirmation dialog chooseFolder.zClickTreeFolder(subFolder); chooseFolder.zClickButton(Button.B_OK); // refresh briefcase page app.zTreeBriefcase.zTreeItem(Action.A_LEFTCLICK, folderItem, false); // Verify document was moved from the folder ZAssert.assertFalse( app.zPageBriefcase.isPresentInListView(fileItem.getName()), "Verify document was moved from the folder"); // click on subfolder in tree view app.zTreeBriefcase.zTreeItem(Action.A_LEFTCLICK, subFolder, true); // Verify document was moved to the selected folder boolean present = app.zPageBriefcase.isPresentInListView(fileItem.getName()); ZAssert.assertTrue(present, "Verify document was moved to the selected folder"); }
@Test( description = "Delete a file from the search results", groups = {"smoke"}) public void DeleteFile_01() throws HarnessException { String filename = "filename" + ZimbraSeleniumProperties.getUniqueString() + ".txt"; String filePath = ZimbraSeleniumProperties.getBaseDirectory() + "/data/public/documents/doc01/plaintext.txt"; // Upload file to server through RestUtil String attachmentId = app.zGetActiveAccount().uploadFile(filePath); // Save uploaded file through SOAP FolderItem briefcaseRootFolder = FolderItem.importFromSOAP(app.zGetActiveAccount(), SystemFolder.Briefcase); FolderItem trashFolder = FolderItem.importFromSOAP(app.zGetActiveAccount(), SystemFolder.Trash); app.zGetActiveAccount() .soapSend( "<SaveDocumentRequest xmlns='urn:zimbraMail'>" + "<doc name='" + filename + "' l='" + briefcaseRootFolder.getId() + "'>" + "<upload id='" + attachmentId + "'/>" + "</doc>" + "</SaveDocumentRequest>"); String documentId = app.zGetActiveAccount().soapSelectValue("//mail:doc", "id"); // Sync up // app.zPageOctopus.zToolbarPressButton(Button.B_GETMAIL); // Search for the message app.zPageSearch.zExecuteSearchQuery(filename); // Get all the messages in the view // Verify the uploaded file exists IOctListViewItem found = null; List<IOctListViewItem> items = app.zPageSearch.zGetListViewItems(); for (IOctListViewItem item : items) { if (item.getListViewName().equalsIgnoreCase(filename)) { // found it found = item; break; } } ZAssert.assertNotNull(found, "Verify the item is found in the list after searching"); // Delete the file app.zPageMyFiles.zToolbarPressPulldown( Button.B_MY_FILES_LIST_ITEM, Button.O_DELETE, found.getListViewName()); // Verify the document is shared app.zGetActiveAccount() .soapSend( "<GetItemRequest xmlns='urn:zimbraMail'>" + "<item id='" + documentId + "'/>" + "</GetItemRequest>"); String id = app.zGetActiveAccount().soapSelectValue("//mail:doc[@id='" + documentId + "']", "l"); ZAssert.assertEquals(id, trashFolder.getId(), "Verify the folder is moved to trash"); }