/** * Quick Command: Item Type: Mail Action 1: Tag Action 2: Mark Read Action 3: Mark Flagged Action * 4: Move To Subfolder * * @throws HarnessException */ protected QuickCommand getQuickCommand01() throws HarnessException { if (command1 != null) { // Command already exists, just return it return (command1); } // Create a tag String tagname = "tag" + ZimbraSeleniumProperties.getUniqueString(); ZimbraAccount.AccountZWC() .soapSend( "<CreateTagRequest xmlns='urn:zimbraMail'>" + "<tag name='" + tagname + "' color='1' />" + "</CreateTagRequest>"); TagItem tag = TagItem.importFromSOAP(ZimbraAccount.AccountZWC(), tagname); ZAssert.assertNotNull(tag, "Verify the tag was created"); // Create a subfolder String foldername = "folder" + ZimbraSeleniumProperties.getUniqueString(); ZimbraAccount.AccountZWC() .soapSend( "<CreateFolderRequest xmlns='urn:zimbraMail'>" + "<folder name='" + foldername + "' l='1' view='message'/>" + "</CreateFolderRequest>"); FolderItem folder = FolderItem.importFromSOAP(ZimbraAccount.AccountZWC(), foldername); ZAssert.assertNotNull(folder, "Verify the subfolder is available"); // Create the list of actions ArrayList<QuickCommandAction> actions = new ArrayList<QuickCommandAction>(); actions.add(new QuickCommandAction(QuickCommandAction.TypeId.actionTag, tag.getId(), true)); actions.add(new QuickCommandAction(QuickCommandAction.TypeId.actionFlag, "read", true)); actions.add(new QuickCommandAction(QuickCommandAction.TypeId.actionFlag, "flagged", true)); actions.add( new QuickCommandAction(QuickCommandAction.TypeId.actionFileInto, folder.getId(), true)); String name = "name" + ZimbraSeleniumProperties.getUniqueString(); String description = "description" + ZimbraSeleniumProperties.getUniqueString(); command1 = new QuickCommand(name, description, ItemTypeId.MSG, true); command1.addActions(actions); return (command1); }
/** * Set up basic quick commands for all combinations * * @throws HarnessException */ @Bugs(ids = "71389") // Hold off on GUI implementation of Quick Commands in 8.X // @BeforeClass( groups = { "always" } ) public void addQuickCommands() throws HarnessException { logger.info("addQuickCommands: start"); // Create a quick command in the user preferences ZimbraAccount.AccountZWC() .soapSend( "<ModifyPrefsRequest xmlns='urn:zimbraAccount'>" + "<pref name='zimbraPrefQuickCommand'>" + this.getQuickCommand01().toString() + "</pref>" + "<pref name='zimbraPrefQuickCommand'>" + this.getQuickCommand02().toString() + "</pref>" + "<pref name='zimbraPrefQuickCommand'>" + this.getQuickCommand03().toString() + "</pref>" + "</ModifyPrefsRequest>"); // Re-login to pick up the new preferences super.startingPage.zRefresh(); // The AjaxCommonTest.commonTestBeforeMethod() method will log into the client logger.info("addQuickCommands: finish"); }