示例#1
0
  // --------------------------------------------------------------------------
  // SECTION 1: DATA-PROVIDERS
  // --------------------------------------------------------------------------
  @DataProvider(name = "dataProvider")
  public Object[][] createData(Method method) throws Exception {
    String test = method.getName();
    if (test.equals("cancelingComposeInNewWindowSavesDraft_Bug43560")) {
      return new Object[][] {
        {
          ClientSessionFactory.session().currentUserName(),
          ClientSessionFactory.session().currentUserName(),
          Stafzmprov.getRandomAccount(),
          "*****@*****.**",
          "subject_cancelingComposeInNewWindowSavesDraft_Bug43560",
          "body_cancelingComposeInNewWindowSavesDraft_Bug43560",
          ""
        }
      };
    } else if (test.equals("cancelingComposeInNewWindowAndSavingDraft")) {
      return new Object[][] {
        {
          ClientSessionFactory.session().currentUserName(),
          ClientSessionFactory.session().currentUserName(),
          Stafzmprov.getRandomAccount(),
          "*****@*****.**",
          "subject_cancelingComposeInNewWindowSavingDraft",
          "body_cancelingComposeInNewWindowSavingDraft",
          ""
        }
      };

    } else {
      return new Object[][] {{""}};
    }
  }
示例#2
0
 @DataProvider(name = "SigPrefDataProvider")
 public Object[][] createData(Method method) throws ServiceException {
   String test = method.getName();
   if (test.equals("verifyTextSignatureAboveIncludedMsgInReply_Bug45880")
       || test.equals("verifyTextSignatureBelowIncludedMsgInReply_Bug45880")
       || test.equals("verifyHtmlSignatureAboveIncludedMsgInReply_Bug45880")
       || test.equals("verifyHtmlSignatureBelowIncludedMsgInReply_Bug45880")
       || test.equals("verifyTextSignatureAboveIncludedMsgInFwd_Bug45880")
       || test.equals("verifyHtmlSignatureAboveIncludedMsgInFwd_Bug45880")
       || test.equals("verifyTextSignatureBelowIncludedMsgInFwd_Bug45880")
       || test.equals("verifyHtmlSignatureBelowIncludedMsgInFwd_Bug45880")
       || test.equals("verifyTextSignatureAboveIncludedMsgInReplyAll_Bug45880")
       || test.equals("verifyTextSignatureBelowIncludedMsgInReplyAll_Bug45880")
       || test.equals("verifyHtmlSignatureAboveIncludedMsgInReplyAll_Bug45880")
       || test.equals("verifyHtmlSignatureBelowIncludedMsgInReplyAll_Bug45880")
       || test.equals("twoSignaturesOnSwitching_Bug41404")) {
     return new Object[][] {
       {
         getLocalizedData_NoSpecialChar(),
         getLocalizedData_NoSpecialChar(),
         ClientSessionFactory.session().currentUserName(),
         "*****@*****.**",
         "*****@*****.**",
         getLocalizedData_NoSpecialChar(),
         getLocalizedData_NoSpecialChar(),
         ""
       }
     };
   } else return new Object[][] {{""}};
 }
示例#3
0
 public void zVerifyCurrentMsgHeaderText(String requiredTxt) throws HarnessException {
   String actual =
       ClientSessionFactory.session()
           .selenium()
           .call("msgHeaderCore", "", "gettext", true, "", "");
   Assert.assertTrue(actual.indexOf(requiredTxt) >= 0);
 }
示例#4
0
  // --------------------------------------------------------------------------
  // SECTION 3: TEST-METHODS
  // --------------------------------------------------------------------------
  @Test(
      dataProvider = "mailDataProvider",
      groups = {"smoke", "full"},
      retryAnalyzer = RetryFailedTests.class)
  public void addingAttachFromMsgToBriefcaseFolder(
      String to, String cc, String bcc, String subject, String body, String attachments)
      throws Exception {
    if (SelNGBase.isExecutionARetry.get()) handleRetry1();

    checkForSkipException("all", "na", "46702", "can not move attachment to briefcase folder");

    zGoToApplication("Mail");
    page.zComposeView.zNavigateToMailCompose();
    page.zComposeView.zSendMailToSelfAndVerify(
        ClientSessionFactory.session().currentUserName(), cc, bcc, subject, body, attachments);
    obj.zMessageItem.zClick(subject);
    SleepUtil.sleep(2000);
    if (ZimbraSeleniumProperties.getStringProperty("browser").equals("IE")) {
      Assert.assertTrue(
          ClientSessionFactory.session()
              .selenium()
              .isElementPresent(
                  "xpath=//div[contains(@id,'zlif__CLV') and contains(@class,'ImgAttachment')]"),
          "Attachment symbol does not found");
    } else {
      obj.zMessageItem.zVerifyHasAttachment(subject);
    }
    // obj.zMessageItem.zVerifyHasAttachment(subject);
    if (ZimbraSeleniumProperties.getStringProperty("locale").equals("nl")) {
      ClientSessionFactory.session().selenium().click("link=Aktetas");
    } else {
      ClientSessionFactory.session().selenium().click("link=" + localize(locator.briefcase));
    }
    obj.zFolder.zClickInDlgByName(
        localize(locator.briefcase), localize(locator.addToBriefcaseTitle));
    obj.zButton.zClickInDlgByName(localize(locator.ok), localize(locator.addToBriefcaseTitle));

    zGoToApplication("Briefcase");
    obj.zFolder.zClick(page.zBriefcaseApp.zBriefcaseFolder);
    obj.zBriefcaseItem.zExists(attachments);

    SelNGBase.needReset.set(false);
  }
示例#5
0
  @Test(
      dataProvider = "dataProvider",
      groups = {"smoke", "full"},
      retryAnalyzer = RetryFailedTests.class)
  public void cancelingComposeInNewWindowSavesDraft_Bug43560(
      String from,
      String to,
      String cc,
      String bcc,
      String subject,
      String body,
      String attachments)
      throws Exception {
    if (SelNGBase.isExecutionARetry.get()) handleRetry();

    to = ClientSessionFactory.session().currentUserName();
    String recipients[] = {to};
    LmtpUtil.injectMessage(from, recipients, cc, subject, body);
    page.zMailApp.ClickCheckMailUntilMailShowsUp(subject);
    obj.zMessageItem.zClick(subject);
    obj.zButton.zClick(page.zMailApp.zReplyBtn);
    SleepUtil.sleep(1000);
    obj.zButton.zClick("id=zb__COMPOSE1__DETACH_COMPOSE_left_icon");
    SleepUtil.sleep(2000);
    ClientSessionFactory.session().selenium().selectWindow("_blank");
    obj.zEditor.zType("Modifying body");
    obj.zButton.zClick(page.zComposeView.zCancelIconBtn);
    SleepUtil.sleep(1000);
    obj.zButton.zClickInDlgByName(localize(locator.no), localize(locator.warningMsg));
    SleepUtil.sleep(1000);
    ClientSessionFactory.session().selenium().selectWindow(null);
    obj.zFolder.zClick(page.zMailApp.zDraftsFldr);
    SleepUtil.sleep(1000);
    assertReport("false", obj.zMessageItem.zExistsDontWait(subject), "Verifying drafted message");

    SelNGBase.needReset.set(false);
  }
示例#6
0
 // --------------------------------------------------------------------------
 // SECTION 1: DATA-PROVIDERS
 // --------------------------------------------------------------------------
 @DataProvider(name = "mailDataProvider")
 public Object[][] createData(Method method) throws ServiceException {
   String test = method.getName();
   if (test.equals("addingAttachFromMsgToBriefcaseFolder")) {
     return new Object[][] {
       {
         ClientSessionFactory.session().currentUserName(),
         "*****@*****.**",
         "*****@*****.**",
         getLocalizedData(5),
         getLocalizedData(5),
         "data/public/other/testtextfile.txt"
       }
     };
   } else {
     return new Object[][] {{""}};
   }
 }
示例#7
0
 // --------------------------------------------------------------------------
 // SECTION 1: DATA-PROVIDERS
 // --------------------------------------------------------------------------
 @DataProvider(name = "dataProvider")
 public Object[][] createData(Method method) throws ServiceException {
   String test = method.getName();
   if (test.equals("test1")) {
     return new Object[][] {
       {
         ClientSessionFactory.session().currentUserName(),
         "*****@*****.**",
         "*****@*****.**",
         getLocalizedData(5),
         getLocalizedData(5),
         "data/public/other/testexcelfile.xls"
       }
     };
   } else {
     return new Object[][] {{""}};
   }
 }
示例#8
0
  /** This test creates folder and moves it */
  @Test(
      dataProvider = "FolderDataProvider",
      groups = {"smoke", "full"},
      retryAnalyzer = RetryFailedTests.class)
  public void moveAndVerifyFolder(
      String folderName, String renameFolderName, String errDlgName, String errMsg)
      throws Exception {
    if (SelNGBase.isExecutionARetry.get()) handleRetry();

    page.zMailApp.zCreateFolder(folderName);
    zDragAndDrop(
        "//td[contains(@id, 'zti__main_Mail') and contains(text(), '" + folderName + "')]",
        page.zMailApp.zTrashFldr);
    Assert.assertTrue(
        ClientSessionFactory.session()
            .selenium()
            .isElementPresent(
                "//div[@id='zti__main_Mail__3']/div[@class='DwtTreeItemChildDiv']//td[contains(text(), '"
                    + folderName
                    + "')]"));

    SelNGBase.needReset.set(false);
  }
示例#9
0
  @Test(
      dataProvider = "SigPrefDataProvider",
      groups = {"smoke", "full"},
      retryAnalyzer = RetryFailedTests.class)
  public void twoSignaturesOnSwitching_Bug41404(String signatureName, String signatureBody)
      throws Exception {
    if (SelNGBase.isExecutionARetry.get()) handleRetry();

    String defaultSignature = signatureName + "_default";
    String defaultSignatureBody = signatureBody + "_default";
    String nondefaultSignatureBody = signatureBody + "_non_default";

    String subject = "signature test";
    String body = "This is test body.";

    page.zMailApp.zNavigateToComposingPreferences();
    obj.zRadioBtn.zClick(localize(locator.composeAsHTML));
    obj.zButton.zClick(page.zCalApp.zPreferencesSaveIconBtn);

    /** Following code is added to test bug 43244 */
    page.zSignaturePref.zNavigateToPreferenceSignature();
    obj.zButton.zClick(localize(locator.formatAsText));
    obj.zMenuItem.zClick(localize(locator.formatAsHtml));
    SleepUtil.sleep(1000);
    ClientSessionFactory.session().selenium().clickAt("//*[contains(@class,'ImgImageDoc')]", "");
    obj.zButton.zClickInDlgByName(localize(locator.cancel), localize(locator.addImg));
    ClientSessionFactory.session().selenium().clickAt("//*[contains(@class,'ImgInsertImage')]", "");
    obj.zButton.zClickInDlgByName(localize(locator.cancel), localize(locator.uploadImage));
    /** Code for bug 43244 ends here. */

    /** Create Signature 1 */
    page.zSignaturePref.zNavigateToPreferenceSignature();
    page.zSignaturePref.zCreateSignature(defaultSignature, defaultSignatureBody, "TEXT");

    SleepUtil.sleep(1000);
    obj.zButton.zClick(page.zABCompose.zPreferencesSaveIconBtn);
    SleepUtil.sleep(1000);

    /** Create Signature 2 */
    page.zSignaturePref.zNavigateToPreferenceSignature();
    obj.zButton.zClick(localize(locator.addSignature));
    page.zSignaturePref.zCreateSignature(signatureName, nondefaultSignatureBody, "TEXT");
    SleepUtil.sleep(1000);
    obj.zButton.zClick(page.zABCompose.zPreferencesSaveIconBtn);
    SleepUtil.sleep(1000);

    /** Make Signature 1 default */
    page.zAccPref.zNavigateToPreferenceAccount();
    obj.zButton.zClick(localize(locator.signatureDoNotAttach));
    obj.zMenuItem.zClick(defaultSignature);
    SleepUtil.sleep(1000);
    obj.zButton.zClick(page.zABCompose.zPreferencesSaveIconBtn);
    SleepUtil.sleep(1000);

    /**
     * 1. Compose Mail. 2. Switch Signature to non-default. 3. Switch back to default signature. 4.
     * Send Mail to self and click on received mail.
     */
    page.zMailApp.zNavigateToMailApp();
    obj.zButton.zClick(page.zMailApp.zNewMenuIconBtn);
    page.zComposeView.zEnterComposeValues("_selfAccountName_", "", "", subject, body, "");
    obj.zButton.zClick(ComposeView.zSignatureIconBtn);
    obj.zMenuItem.zClick(signatureName);
    obj.zButton.zClick(ComposeView.zSignatureIconBtn);
    obj.zMenuItem.zClick(defaultSignature);
    obj.zButton.zClick(ComposeView.zSendIconBtn);
    SleepUtil.sleep(1000);
    page.zMailApp.ClickCheckMailUntilMailShowsUp(subject);
    zGoToApplication("Mail");
    obj.zFolder.zClick(localize(locator.inbox));
    obj.zMessageItem.zClick(subject);

    /**
     * 1. Verify Body contains default signature. 2. Verify body does not contain non-default
     * signature.
     */
    obj.zMessageItem.zVerifyCurrentMsgBodyText(defaultSignatureBody);
    obj.zMessageItem.zVerifyCurrentMsgBodyDoesNotHaveText(nondefaultSignatureBody);

    SelNGBase.needReset.set(false);
  }
示例#10
0
 public String zGetMsgBodyHTML() throws HarnessException {
   return ClientSessionFactory.session()
       .selenium()
       .call("msgBodyCore", "", "gethtml", true, "", "");
 }
示例#11
0
 public void zVerifyCurrentMsgBodyHasImage() throws HarnessException {
   String actual =
       ClientSessionFactory.session().selenium().call("msgBodyCore", "", "gethtml", true, "", "");
   Assert.assertTrue(actual.indexOf("dfsrc=") >= 0);
 }
示例#12
0
 public String zGetCurrentMsgBodyText() throws HarnessException {
   return ClientSessionFactory.session()
       .selenium()
       .call("msgBodyCore", "", "gettext", true, "", "");
 }