@Test(
      description = "D1 Enhancement : Add a contact to an existing group",
      groups = {"smoke", "matt"})
  public void Add1ContactToExistingGroup() throws HarnessException {

    // -- Data

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

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

    // -- GUI

    // Refresh
    app.zPageAddressbook.zRefresh();

    // Right click on the contact -> Group -> Existing Group Name
    app.zPageAddressbook.zListItem(
        Action.A_RIGHTCLICK, Button.B_CONTACTGROUP, group, contact.getName());

    // -- Verification

    // Verify the contact group is created
    ContactGroupItem actual =
        ContactGroupItem.importFromSOAP(app.zGetActiveAccount(), group.getName());
    ZAssert.assertNotNull(actual, "Verify the contact group is created");

    // Verify the contact group contains the contact
    ZAssert.assertContains(
        actual.getMemberList(),
        new ContactGroupItem.MemberItemContact(contact),
        "Verify the contact group conatins the contact");
  }
  @Test(
      description = "D1 Enhancement : Add 1 contact + 1 group to an existing group",
      groups = {"functional"})
  public void Add1ContactAnd1GroupToExistingGroup() throws HarnessException {

    // -- Data

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

    // Create a contact group
    ContactGroupItem group1 = ContactGroupItem.createContactGroupItem(app.zGetActiveAccount());
    ContactGroupItem group2 = ContactGroupItem.createContactGroupItem(app.zGetActiveAccount());

    // -- GUI

    // Refresh
    app.zPageAddressbook.zRefresh();

    // Check 3 contact items
    app.zPageAddressbook.zListItem(Action.A_CHECKBOX, contact.getName());
    app.zPageAddressbook.zListItem(Action.A_CHECKBOX, group1.getName());

    // Right click on one contact -> Group -> Existing Group Name
    app.zPageAddressbook.zListItem(
        Action.A_RIGHTCLICK, Button.B_CONTACTGROUP, group2, contact.getName());

    // -- Verification

    // Verify the contact group is created
    ContactGroupItem actual =
        ContactGroupItem.importFromSOAP(app.zGetActiveAccount(), group1.getName());
    ZAssert.assertNotNull(actual, "Verify the contact group is created");

    // Verify the contact group contains the contact
    ZAssert.assertContains(
        actual.getMemberList(),
        new ContactGroupItem.MemberItemContact(contact),
        "Verify the contact group conatins the contact");

    // The group members will be added to the new group
    for (ContactGroupItem.MemberItem m : group1.getMemberList()) {
      ZAssert.assertContains(
          actual.getMemberList(), m, "Verify the contact group contains the group members");
    }
  }
Пример #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");
  }
  @Test(
      description = "D1 Enhancement : Create a contact group with 1 contact + 1 group",
      groups = {"functional"})
  public void CreateContactGroupWith1ContactAnd1Group() throws HarnessException {

    // -- Data

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

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

    String groupname = "group" + ZimbraSeleniumProperties.getUniqueString();

    // -- GUI

    // Refresh
    app.zPageAddressbook.zRefresh();

    // Check 3 contact items
    app.zPageAddressbook.zListItem(Action.A_CHECKBOX, contact.getName());
    app.zPageAddressbook.zListItem(Action.A_CHECKBOX, group.getName());

    // Right click on one contact -> Group -> Existing Group Name
    DialogNewContactGroup dialog =
        (DialogNewContactGroup)
            app.zPageAddressbook.zListItem(
                Action.A_RIGHTCLICK,
                Button.B_CONTACTGROUP,
                Button.O_NEW_CONTACTGROUP,
                contact.getName());

    dialog.zEnterGroupName(groupname);
    dialog.zClickButton(Button.B_OK);

    // -- Verification

    // Verify the contact group is created
    ContactGroupItem actual = ContactGroupItem.importFromSOAP(app.zGetActiveAccount(), groupname);
    ZAssert.assertNotNull(actual, "Verify the contact group is created");

    // Verify the contact group contains the contact
    ZAssert.assertContains(
        actual.getMemberList(),
        new ContactGroupItem.MemberItemContact(contact),
        "Verify the contact group conatins the contact");

    // The group members will be added to the new group
    for (ContactGroupItem.MemberItem m : group.getMemberList()) {
      ZAssert.assertContains(
          actual.getMemberList(), m, "Verify the contact group contains the group members");
    }
  }
Пример #5
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");
  }
Пример #6
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");
  }
Пример #7
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");
  }
Пример #8
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");
  }