예제 #1
0
  private void TagGroup(DialogTag dialogTag, ContactGroupItem group) throws HarnessException {

    String tagName = "tag" + ZimbraSeleniumProperties.getUniqueString();
    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");

    // Make sure the tag was applied to the contact
    app.zGetActiveAccount()
        .soapSend(
            "<GetContactsRequest xmlns='urn:zimbraMail'>"
                + "<cn id='"
                + group.getId()
                + "'/>"
                + "</GetContactsRequest>");

    String contactTags =
        app.zGetActiveAccount().soapSelectValue("//mail:GetContactsResponse//mail:cn", "t");

    ZAssert.assertEquals(
        contactTags, tagID, "Verify the tag appears on the contact id=" + group.getId());

    // verify toasted message '1 contact tagged ...'
    String expectedMsg = "1 contact group tagged \"" + tagName + "\"";
    ZAssert.assertStringContains(
        app.zPageMain.zGetToaster().zGetToastMessage(),
        expectedMsg,
        "Verify toast message '" + expectedMsg + "'");
  }
예제 #2
0
  @Test(
      description = "Tag a contact group by dnd on an existing tag",
      groups = {"functional"})
  public void DnDOnExistingTag() throws HarnessException {

    // -- Data

    // Create a tag
    TagItem tagItem = TagItem.CreateUsingSoap(app.zGetActiveAccount());

    // Create a contact group via Soap then select
    ContactGroupItem group = ContactGroupItem.createContactGroupItem(app.zGetActiveAccount());

    // -- GUI

    // Refresh
    app.zPageAddressbook.zRefresh();

    // Dnd on the new tag
    app.zPageAddressbook.zDragAndDrop(
        "css=[id=zlif__CNS-main__" + group.getId() + "__fileas]:contains(" + group.getName() + ")",
        "css=div[id=main_Contacts-parent-TAG] div[id=ztih__main_Contacts__TAG] td[id^=zti__main_Contacts__][id$=_textCell]:contains("
            + tagItem.getName()
            + ")");

    // -- Verification

    app.zGetActiveAccount()
        .soapSend(
            "<GetContactsRequest xmlns='urn:zimbraMail' >"
                + "<cn id='"
                + group.getId()
                + "'/>"
                + "</GetContactsRequest>");

    String t = app.zGetActiveAccount().soapSelectValue("//mail:cn", "t");
    ZAssert.assertNotNull(t, "Verify the contact has tags");
    ZAssert.assertStringContains(
        t, tagItem.getId(), "Verify the contact is tagged with the correct tag");
  }
예제 #3
0
  @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");
  }
예제 #4
0
  @Test(
      description = "Double tag a group ",
      groups = {"functional"})
  public void DoubleTag() throws HarnessException {

    // -- Data

    // Create a tag
    TagItem tag1 = TagItem.CreateUsingSoap(app.zGetActiveAccount());
    TagItem tag2 = TagItem.CreateUsingSoap(app.zGetActiveAccount());

    // Create a contact group via Soap then select
    ContactGroupItem group = ContactGroupItem.createContactGroupItem(app.zGetActiveAccount());

    // -- GUI

    // Refresh
    app.zPageAddressbook.zRefresh();

    // Select the contact group
    app.zPageAddressbook.zListItem(Action.A_LEFTCLICK, group.getName());

    // Tag -> Existing Tag
    app.zPageAddressbook.zToolbarPressPulldown(Button.B_TAG, tag1);
    app.zPageAddressbook.zToolbarPressPulldown(Button.B_TAG, tag2);

    // -- Verification

    app.zGetActiveAccount()
        .soapSend(
            "<GetContactsRequest xmlns='urn:zimbraMail' >"
                + "<cn id='"
                + group.getId()
                + "'/>"
                + "</GetContactsRequest>");

    String t = app.zGetActiveAccount().soapSelectValue("//mail:cn", "t");
    ZAssert.assertNotNull(t, "Verify the contact has tags");
    ZAssert.assertStringContains(
        t, tag1.getId(), "Verify the contact is tagged with the correct tag");
    ZAssert.assertStringContains(
        t, tag2.getId(), "Verify the contact is tagged with the correct tag");
  }
예제 #5
0
  @Test(
      description = "Right click then click Tag Contact Group->a tag name",
      groups = {"functional"})
  public void ClickContextMenuTagContactExistingTag() throws HarnessException {

    // -- Data

    // Create a tag
    TagItem tagItem = TagItem.CreateUsingSoap(app.zGetActiveAccount());

    // Create a contact group via Soap then select
    ContactGroupItem group = ContactGroupItem.createContactGroupItem(app.zGetActiveAccount());

    // -- GUI

    // Refresh
    app.zPageAddressbook.zRefresh();

    // Right Click -> Tag -> Existing Tag
    app.zPageAddressbook.zListItem(Action.A_RIGHTCLICK, Button.B_TAG, tagItem, group.getName());

    // -- Verification

    app.zGetActiveAccount()
        .soapSend(
            "<GetContactsRequest xmlns='urn:zimbraMail' >"
                + "<cn id='"
                + group.getId()
                + "'/>"
                + "</GetContactsRequest>");

    String t = app.zGetActiveAccount().soapSelectValue("//mail:cn", "t");
    ZAssert.assertNotNull(t, "Verify the contact has tags");
    ZAssert.assertStringContains(
        t, tagItem.getId(), "Verify the contact is tagged with the correct tag");
  }
예제 #6
0
  @Test(
      description =
          "Delete a contact, group, and folder permanently by Empty Trash folder on context menu",
      groups = {"smoke"})
  public void ClickOK() throws HarnessException {

    // -- Data

    // The trash folder
    FolderItem trash = FolderItem.importFromSOAP(app.zGetActiveAccount(), SystemFolder.Trash);

    // Create a contact group via Soap
    ContactGroupItem group = ContactGroupItem.createContactGroupItem(app.zGetActiveAccount());

    // Move to trash
    app.zGetActiveAccount()
        .soapSend(
            "<ItemActionRequest xmlns='urn:zimbraMail'>"
                + "<action op='move' id='"
                + group.getId()
                + "' l='"
                + trash.getId()
                + "'/>"
                + "</ItemActionRequest>");

    // Create a contact via Soap
    ContactItem contact = ContactItem.createContactItem(app.zGetActiveAccount());

    // Move to trash
    app.zGetActiveAccount()
        .soapSend(
            "<ItemActionRequest xmlns='urn:zimbraMail'>"
                + "<action op='move' id='"
                + contact.getId()
                + "' l='"
                + trash.getId()
                + "'/>"
                + "</ItemActionRequest>");

    // Create a new folder in trash
    String name = "ab" + ZimbraSeleniumProperties.getUniqueString();
    app.zGetActiveAccount()
        .soapSend(
            "<CreateFolderRequest xmlns='urn:zimbraMail'>"
                + "<folder name='"
                + name
                + "' view='contact' l='"
                + trash.getId()
                + "'/>"
                + "</CreateFolderRequest>");

    // -- GUI

    // Refresh
    app.zPageAddressbook.zRefresh();

    // Now open empty trash dialog
    DialogWarning dialogWarning =
        (DialogWarning)
            app.zTreeContacts.zTreeItem(Action.A_RIGHTCLICK, Button.B_TREE_FOLDER_EMPTY, trash);

    // Click OK
    dialogWarning.zClickButton(Button.B_OK);

    // -- Verification

    // Verify items are permanently deleted

    // Verify Trash folder is empty
    ContactItem actualContact =
        ContactItem.importFromSOAP(
            app.zGetActiveAccount(), "is:anywhere #firstname:" + contact.firstName);
    ZAssert.assertNull(actualContact, "Verify the contact is deleted");

    ContactGroupItem actualGroup =
        ContactGroupItem.importFromSOAP(app.zGetActiveAccount(), "is:anywhere " + group.getName());
    ZAssert.assertNull(actualGroup, "Verify the contact group is deleted");

    FolderItem actualAddressbook = FolderItem.importFromSOAP(app.zGetActiveAccount(), name);
    ZAssert.assertNull(actualAddressbook, "Verify the addressbook is deleted");
  }