@Test( description = "Double tag a contact ", groups = {"functional"}) public void DoubleTag() throws HarnessException { // Create a new tag TagItem tagItem = TagItem.CreateUsingSoap(app); // Create a contact via Soap then select ContactItem contactItem = app.zPageAddressbook.createUsingSOAPSelectContact(app, Action.A_LEFTCLICK); // select the tag app.zPageAddressbook.zToolbarPressPulldown(Button.B_TAG, tagItem); Verify(contactItem, tagItem.getName()); // create a new tag name String tagName = "tag" + ZimbraSeleniumProperties.getUniqueString(); // click Tag Contact->New Tag DialogTag dialogTag = (DialogTag) app.zPageAddressbook.zListItem( Action.A_RIGHTCLICK, Button.B_TAG, Button.O_TAG_NEWTAG, contactItem.fileAs); dialogTag.zSetTagName(tagName); dialogTag.zClickButton(Button.B_OK); Verify(contactItem, tagName); }
@AfterMethod(groups = {"always"}) public void afterMethod() throws HarnessException { logger.info("Checking for the Create New Tag Dialog ..."); // Check if the "Create New Tag Dialog is still open DialogTag dialogtag = new DialogTag(app, ((AppAjaxClient) app).zPageTasks); if (dialogtag.zIsActive()) { logger.warn(dialogtag.myPageName() + " was still active. Cancelling ..."); dialogtag.zClickButton(Button.B_CANCEL); } }
@Test( description = "Tag a contact group, click pulldown menu Tag->New Tag", groups = {"smoke"}) public void ClickPulldownMenuTagNewTag() throws HarnessException { // -- Data // Create a tag String tagName = "tag" + ZimbraSeleniumProperties.getUniqueString(); // Create a contact group via Soap then select ContactGroupItem group = ContactGroupItem.createContactGroupItem(app.zGetActiveAccount()); // -- GUI // Refresh app.zPageAddressbook.zRefresh(); // Select the contact app.zPageAddressbook.zListItem(Action.A_LEFTCLICK, group.getName()); // click Tag Contact->New Tag DialogTag dialogTag = (DialogTag) app.zPageAddressbook.zListItem( Action.A_RIGHTCLICK, Button.B_TAG, Button.O_TAG_NEWTAG, group.getName()); dialogTag.zSetTagName(tagName); dialogTag.zClickButton(Button.B_OK); // -- Verification app.zGetActiveAccount() .soapSend( "<GetContactsRequest xmlns='urn:zimbraMail' >" + "<cn id='" + group.getId() + "'/>" + "</GetContactsRequest>"); String tn = app.zGetActiveAccount().soapSelectValue("//mail:cn", "tn"); ZAssert.assertNotNull(tn, "Verify the contact has tags"); ZAssert.assertStringContains(tn, tagName, "Verify the contact is tagged with the correct tag"); }
@Test( description = "Tag a contact, click pulldown menu Tag->New Tag", groups = {"smoke"}) public void ClickPulldownMenuTagNewTag() throws HarnessException { // Create a contact via Soap then select ContactItem contactItem = app.zPageAddressbook.createUsingSOAPSelectContact(app, Action.A_LEFTCLICK); String tagName = "tag" + ZimbraSeleniumProperties.getUniqueString(); // Click new tag DialogTag dialogTag = (DialogTag) app.zPageAddressbook.zToolbarPressPulldown(Button.B_TAG, Button.O_TAG_NEWTAG); dialogTag.zSetTagName(tagName); dialogTag.zClickButton(Button.B_OK); Verify(contactItem, tagName); }
@Test( description = "Right click then click Tag Contact->New Tag", groups = {"smoke"}) public void ClickContextMenuTagContactNewTag() throws HarnessException { // Create a contact via Soap then select ContactItem contactItem = app.zPageAddressbook.createUsingSOAPSelectContact(app, Action.A_LEFTCLICK); String tagName = "tag" + ZimbraSeleniumProperties.getUniqueString(); // click Tag Contact->New Tag DialogTag dialogTag = (DialogTag) app.zPageAddressbook.zListItem( Action.A_RIGHTCLICK, Button.B_TAG, Button.O_TAG_NEWTAG, contactItem.fileAs); dialogTag.zSetTagName(tagName); dialogTag.zClickButton(Button.B_OK); Verify(contactItem, tagName); }
@Test( description = "Tag a Task using Toolbar -> Tag -> New Tag", groups = {"smoke"}) public void TagTask_01() throws HarnessException { FolderItem taskFolder = FolderItem.importFromSOAP(app.zGetActiveAccount(), SystemFolder.Tasks); 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>"); TaskItem task = TaskItem.importFromSOAP(app.zGetActiveAccount(), subject); ZAssert.assertNotNull(task, "Verify the task is created"); // Refresh the tasks view app.zTreeTasks.zTreeItem(Action.A_LEFTCLICK, taskFolder); // Select the item app.zPageTasks.zListItem(Action.A_LEFTCLICK, subject); // Create a tag using GUI String tagName = "tag" + ZimbraSeleniumProperties.getUniqueString(); // Click on New Tag and check for active DialogTag dialogtag = (DialogTag) app.zPageTasks.zToolbarPressPulldown(Button.B_TAG, Button.O_TAG_NEWTAG); ZAssert.assertNotNull(dialogtag, "Verify that the Create New Tag dialog is active"); ZAssert.assertTrue(dialogtag.zIsActive(), "Verify that the Create New Tag dialog is active"); // Fill Name and Press OK button 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"); // Verify tagged task name app.zGetActiveAccount() .soapSend( "<SearchRequest xmlns='urn:zimbraMail' types='task'>" + "<query>tag:" + tagName + "</query>" + "</SearchRequest>"); String name = app.zGetActiveAccount().soapSelectValue("//mail:SearchResponse//mail:task", "name"); ZAssert.assertEquals(name, subject, "Verify tagged task name"); // Make sure the tag was applied to the task app.zGetActiveAccount() .soapSend( "<SearchRequest xmlns='urn:zimbraMail' types='task'>" + "<query>" + subject + "</query>" + "</SearchRequest>"); String id = app.zGetActiveAccount().soapSelectValue("//mail:SearchResponse//mail:task", "t"); ZAssert.assertEquals(id, tagID, "Verify the tag was attached to the task"); }