@Test(
      description = "Create Simple Html signature through GUI",
      groups = {"sanity"})
  public void CreateBasicHtmlSignature() throws HarnessException {

    String sigName = "signame" + ZimbraSeleniumProperties.getUniqueString();
    String sigBody = "sigbody" + ZimbraSeleniumProperties.getUniqueString();

    // click on signature from left pane
    app.zTreePreferences.zTreeItem(Action.A_LEFTCLICK, TreeItem.MailSignatures);

    // Click on New signature button
    FormSignatureNew signew =
        (FormSignatureNew) app.zPageSignature.zToolbarPressButton(Button.B_NEW);

    // select html format from drop down
    signew.zSelectFormat("html");
    // Reason:With "?dev=1&debug=0", Tinymce editor in HTML mode takes more time to load
    // commented out incompatible to webdriver reference
    // if(ClientSessionFactory.session().selenium().getEval("window.tinyMCE").equalsIgnoreCase("null")){
    SleepUtil.sleepVeryLong();
    // }
    // Fill Signature Name and body
    signew.zFillField(Field.SignatureName, sigName);
    signew.zFillField(Field.SignatureHtmlBody, sigBody);
    signew.zSubmit();

    SignatureItem signature = SignatureItem.importFromSOAP(app.zGetActiveAccount(), sigName);

    // Verify signature name and body contents
    ZAssert.assertEquals(signature.getName(), sigName, "Verify signature Name");
    ZAssert.assertStringContains(signature.dBodyHtmlText, sigBody, "Verify Html signature body");
    // ZAssert.assertEquals(signature.dBodyHtmlText,sigBody,"Verify Html signature body");

  }
예제 #2
0
  /**
   * Test case :Delete Text signature using Delete button and verify toast msg throguh GUI @Steps:
   * Create signature through soap Delete signature using delete button. Verify signature toast msg
   *
   * @throws HarnessException
   */
  @Test(
      description = " Delete Text signature using Delete button and verify toast msg throguh GUI ",
      groups = {"smoke"})
  public void DeleteSignaturesToastMsg() throws HarnessException {

    // Click on Mail/signature
    app.zTreePreferences.zTreeItem(Action.A_LEFTCLICK, TreeItem.MailSignatures);

    // Signature is created
    SignatureItem signature = SignatureItem.importFromSOAP(app.zGetActiveAccount(), this.sigName);
    ZAssert.assertEquals(signature.getName(), this.sigName, "verified Text Signature is created");

    FormSignatureNew signew = new FormSignatureNew(app);

    // Select signature which is to be Delete
    signew.zClick(Locators.zSignatureListView);
    signew.zClick("//td[contains(text(),'" + signature.getName() + "')]");

    // click Delete button
    app.zPageSignature.zToolbarPressButton(Button.B_DELETE);
    // click Save
    signew.zSubmit();

    // Verifying the toaster message
    Toaster toast = app.zPageMain.zGetToaster();
    String toastMsg = toast.zGetToastMessage();
    ZAssert.assertStringContains(
        toastMsg, "Preferences Saved", "Verify toast message: Preferences Saved");
  }
  @Test(
      description = "Create Simple text signature through GUI",
      groups = {"sanity"})
  public void CreateBasicTextSignature() throws HarnessException {

    String sigName = "signame" + ZimbraSeleniumProperties.getUniqueString();
    String sigBody = "sigbody" + ZimbraSeleniumProperties.getUniqueString();

    // click on signature from left pane
    app.zTreePreferences.zTreeItem(Action.A_LEFTCLICK, TreeItem.MailSignatures);

    // Click on New signature button
    FormSignatureNew signew =
        (FormSignatureNew) app.zPageSignature.zToolbarPressButton(Button.B_NEW);

    // Fill Signature Name and body
    signew.zFillField(Field.SignatureName, sigName);
    signew.zFillField(Field.SignatureBody, sigBody);
    signew.zSubmit();

    SignatureItem signature = SignatureItem.importFromSOAP(app.zGetActiveAccount(), sigName);

    // Verify signature name and body content
    ZAssert.assertEquals(signature.getName(), sigName, "Verify signature Name");
    ZAssert.assertEquals(signature.dBodyText, sigBody, "Verify Text signature body");
  }