예제 #1
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);
  }
예제 #2
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 + "'");
  }
예제 #3
0
  @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);
  }
예제 #4
0
  @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);
  }