//This method will verify the trade activites of Cyclic Report public bool VerifyCyclicReportData(string reportTypeValue, string startDate) { bool flag = false; string ConfirmationCyclicReportModalValue; string confirmationModalStartDate; string cyclicReportMSg; string cyclicReportSummaryTextValue; string cyclicReportFrequencyTextValue; string cyclicReportCreatedDateTimeTextValue; string cyclicReportActionTextValue; string noReportMsg; string reportSummaryTextValue; string createdDateTimeTextValue; string downloadReportBtnTextValue; ConfirmationCyclicReportModalValue = TestData.GetData("TC48_CyclicReportConfirmationModal"); UserCommonFunctions.DashBoardMenuButton(driver); UserCommonFunctions.NavigateToUserSetting(driver); Thread.Sleep(2000); UserSetFunctions.Click(TradeReportsLink()); Thread.Sleep(1000); UserSetFunctions.Click(CyclicReportButton()); if (VerifyCyclicReportTabIsSelectedAndSingleReportAndCyclicReportTabPresent()) { if (VerifyCyclicReportFields() && VerifyCyclicReportFrequencyDropdownValues()) { Thread.Sleep(1000); UserSetFunctions.Click(CyclicReportsTabSelected()); Thread.Sleep(1000); UserSetFunctions.SelectDropdown(ReportType(), reportTypeValue); if (VerifyStartDateSelectableDatesForCyclicReport()) { Thread.Sleep(2000); if (startDate == null) { startDate = GenericUtils.GetCurrentDatePlusOne(); } Thread.Sleep(1000); StartDate().SendKeys(startDate); flag = true; } UserSetFunctions.Click(CreateCyclicReportButton()); VerifyCyclicReportModalConfirmation(); confirmationModalStartDate = StartDateOnConfirmationSingleReportModal().Text; var strtDate = DateTime.Parse(startDate.Trim()); if (DateTime.Parse(confirmationModalStartDate).Equals(strtDate)) { logger.LogCheckPoint(String.Format(LogMessage.StartDateOnCyclicReportConfirmationModalPassed, strtDate.ToString("MM/dd/yyyy"))); } else { logger.Error(String.Format(LogMessage.StartDateOnCyclicReportConfirmationModalFailed, strtDate.ToString("MM/dd/yyyy"))); } UserSetFunctions.Click(ConfirmationModalCreateReportButton()); cyclicReportMSg = ReportCreatedSuccessMsg().Text; if (cyclicReportMSg.Equals(Const.CyclicTradeReportMsg)) { logger.LogCheckPoint(String.Format(LogMessage.SuccessMsgPassed, ConfirmationCyclicReportModalValue)); } else { logger.Error(String.Format(LogMessage.SuccessMsgFailed, ConfirmationCyclicReportModalValue)); } cyclicReportSummaryTextValue = CyclicReportSummaryText().Text; cyclicReportFrequencyTextValue = CyclicReportFrequencyText().Text; cyclicReportCreatedDateTimeTextValue = CyclicReportCreatedDateTimeText().Text; cyclicReportActionTextValue = CyclicReportActionText().Text; VerifyTopMostOfCyclicTradeReports(cyclicReportSummaryTextValue, cyclicReportFrequencyTextValue, cyclicReportCreatedDateTimeTextValue, cyclicReportActionTextValue); UserSetFunctions.Click(CancelReport()); noReportMsg = NoReportIsAvailableText().Text; if (noReportMsg.Equals(Const.noReportAvailableMsg)) { logger.LogCheckPoint(String.Format(LogMessage.VerifyNoReportAvailablePassed, noReportMsg)); } else { logger.Error(String.Format(LogMessage.VerifyNoReportAvailableFailed, noReportMsg)); } } //Need to work for cyclic report and wait for an hour till the report is present in Report available window section reportSummaryTextValue = ReportSummaryText().Text; createdDateTimeTextValue = ReportCreatedDateTimeText().Text; downloadReportBtnTextValue = DownloadReport().Text; VerifyDownloadableTradeReports(reportSummaryTextValue, createdDateTimeTextValue, downloadReportBtnTextValue); } return(flag); }
//This method will verify the trade activites of Cyclic Report public bool VerifyCyclicReportData(string reportTypeValue, string startDate) { bool flag = false; string ConfirmationCyclicReportModalValue; string confirmationModalStartDate; string cyclicReportMSg; string cyclicReportSummaryTextValue; string cyclicReportFrequencyTextValue; string cyclicReportCreatedDateTimeTextValue; string cyclicReportActionTextValue; string noReportMsg; string reportSummaryTextValue; string createdDateTimeTextValue; string downloadReportBtnTextValue; ConfirmationCyclicReportModalValue = TestData.GetData("TC48_CyclicReportConfirmationModal"); try { // Click on "Dashboard" menu button --> "UserSetting" menu button --> "Trade Reports" button UserCommonFunctions.DashBoardMenuButton(driver); UserCommonFunctions.NavigateToUserSetting(driver); Thread.Sleep(2000); UserSetFunctions.Click(TradeReportsLink()); Thread.Sleep(1000); // Click on "Cyclical Report" button UserSetFunctions.Click(CyclicReportButton()); // Verify if Cyclic Report tab is selected bydefault and single, Cyclic tab is present if (VerifyCyclicReportTabIsSelectedAndSingleReportAndCyclicReportTabPresent()) { //Verify below fields are present:accounts, report type and start date, frequency // Verify Frequency has dropdown values hourly, daily, weekly, monthly and annual if (VerifyCyclicReportFields() && VerifyCyclicReportFrequencyDropdownValues()) { Thread.Sleep(1000); UserSetFunctions.Click(CyclicReportsTabSelected()); Thread.Sleep(1000); UserSetFunctions.SelectDropdown(ReportType(), reportTypeValue); if (VerifyStartDateSelectableDatesForCyclicReport(startDate)) { Thread.Sleep(2000); if (startDate == null) { startDate = GenericUtils.GetCurrentDatePlusOne(); } flag = true; } // Click on "Create" button UserSetFunctions.Click(CreateCyclicReportButton()); // Verify the details in cyclic report confirmation modal window VerifyCyclicReportModalConfirmation(); confirmationModalStartDate = StartDateOnConfirmationSingleReportModal().Text; var strtDate = DateTime.Parse(startDate.Trim()); // This will verify the start date in the confirmation window modal of cyclic report if (DateTime.Parse(confirmationModalStartDate).Equals(strtDate)) { logger.LogCheckPoint(String.Format(LogMessage.StartDateOnCyclicReportConfirmationModalPassed, strtDate.ToString("MM/dd/yyyy"))); } else { logger.Error(String.Format(LogMessage.StartDateOnCyclicReportConfirmationModalFailed, strtDate.ToString("MM/dd/yyyy"))); } // Click on "Schedule Report" button UserSetFunctions.Click(ConfirmationModalCreateReportButton()); cyclicReportMSg = ReportCreatedSuccessMsg().Text; // Verify the success message if (cyclicReportMSg.Equals(Const.CyclicTradeReportMsg)) { logger.LogCheckPoint(String.Format(LogMessage.SuccessMsgPassed, ConfirmationCyclicReportModalValue)); } else { logger.Error(String.Format(LogMessage.SuccessMsgFailed, ConfirmationCyclicReportModalValue)); } cyclicReportSummaryTextValue = CyclicReportSummaryText().Text; cyclicReportFrequencyTextValue = CyclicReportFrequencyText().Text; cyclicReportCreatedDateTimeTextValue = CyclicReportCreatedDateTimeText().Text; cyclicReportActionTextValue = CyclicReportActionText().Text; // Verify Report is available under "Cyclic reports" section, Report Summary is "Report Type" // Verify the frequency and created date // Verify delete button is available VerifyTopMostOfCyclicTradeReports(cyclicReportSummaryTextValue, cyclicReportFrequencyTextValue, cyclicReportCreatedDateTimeTextValue, cyclicReportActionTextValue); // Click on "Cancel Report" button UserSetFunctions.Click(CancelReport()); noReportMsg = NoReportIsAvailableText().Text; // Verify that the report is removed from "Cyclic reports" section if (noReportMsg.Equals(Const.noReportAvailableMsg)) { logger.LogCheckPoint(String.Format(LogMessage.VerifyNoReportAvailablePassed, noReportMsg)); } else { logger.Error(String.Format(LogMessage.VerifyNoReportAvailableFailed, noReportMsg)); } } //Need to work for cyclic report and wait for an hour till the report is present in Report available window section reportSummaryTextValue = ReportSummaryText().Text; createdDateTimeTextValue = ReportCreatedDateTimeText().Text; downloadReportBtnTextValue = DownloadReport().Text; VerifyDownloadableTradeReports(reportSummaryTextValue, createdDateTimeTextValue, downloadReportBtnTextValue); return(true); } return(flag); } catch (Exception) { throw; } }