Esempio n. 1
0
  @Test(
      description = "Tag a contact by dnd on an existing tag",
      groups = {"functional"})
  public void DnDOnExistingTag() throws HarnessException {

    // Create a contact via Soap then select
    ContactItem contactItem =
        app.zPageAddressbook.createUsingSOAPSelectContact(app, Action.A_LEFTCLICK);

    // Create a new tag via soap
    TagItem tagItem = TagItem.CreateUsingSoap(app);

    // Refresh to display the new tag
    app.zPageMain.zToolbarPressButton(Button.B_REFRESH);

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

    Verify(contactItem, tagItem.getName());
  }
Esempio n. 2
0
  @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);
  }
Esempio n. 3
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");
  }
Esempio n. 4
0
  @Test(
      description = "Right click then click Tag Contact->a tag name",
      groups = {"functional"})
  public void ClickContextMenuTagContactExistingTag() throws HarnessException {
    // Create a tag
    TagItem tagItem = TagItem.CreateUsingSoap(app);

    // Create a contact via Soap then select
    ContactItem contactItem =
        app.zPageAddressbook.createUsingSOAPSelectContact(app, Action.A_LEFTCLICK);

    // click Tag Contact->the tag name
    app.zPageAddressbook.zListItem(Action.A_RIGHTCLICK, Button.B_TAG, tagItem, contactItem.fileAs);

    Verify(contactItem, tagItem.getName());
  }
Esempio n. 5
0
  @Test(
      description = "click pulldown menu Tag->A tag name",
      groups = {"smoke"})
  public void ClickPulldownMenuTagExistingTag() throws HarnessException {
    // Create a contact via Soap then select
    ContactItem contactItem =
        app.zPageAddressbook.createUsingSOAPSelectContact(app, Action.A_LEFTCLICK);

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

    // select the tag
    app.zPageAddressbook.zToolbarPressPulldown(Button.B_TAG, tagItem);

    Verify(contactItem, tagItem.getName());
  }
Esempio n. 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");
  }
Esempio n. 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");
  }