void SetDefaultReport(IReportInfo reportInfo) { // this.GetRequiredService<IReportService>("DocumentViewerService").SetDefaultReport(reportInfo); // if(this.IsInDesignMode()) return; // ExportService.SetDefaultReport(reportInfo); // PrintService.SetDefaultReport(reportInfo); }
private void PrintCaseTableContent(IReportInfo report, ICaseInfo @case, ICollection <IRemark> remarks) { int procedureWidth = 19; int nameWidth = this.width - 2 * procedureWidth; foreach (ISubjectInfo subject in report.GetSubjects()) { IResultData serialization = report.GetSerializationData(subject, @case); IResultData deserialization = report.GetDeserializationData(subject, @case); this.output.Write(subject.Name.PadRight(nameWidth)); this.output.Write(serialization.Describe().PadLeft(procedureWidth)); this.output.Write(deserialization.Describe().PadLeft(procedureWidth)); this.output.WriteLine(); if (serialization.HasRemark()) { remarks.Add(serialization.GetRemark()); } if (deserialization.HasRemark()) { remarks.Add(deserialization.GetRemark()); } } }
private void PrintCaseTableContent(IReportInfo report, ICaseInfo @case, ICollection<IRemark> remarks) { int procedureWidth = 19; int nameWidth = this.width - 2 * procedureWidth; foreach (ISubjectInfo subject in report.GetSubjects()) { IResultData serialization = report.GetSerializationData(subject, @case); IResultData deserialization = report.GetDeserializationData(subject, @case); this.output.Write(subject.Name.PadRight(nameWidth)); this.output.Write(serialization.Describe().PadLeft(procedureWidth)); this.output.Write(deserialization.Describe().PadLeft(procedureWidth)); this.output.WriteLine(); if (serialization.HasRemark()) { remarks.Add(serialization.GetRemark()); } if (deserialization.HasRemark()) { remarks.Add(deserialization.GetRemark()); } } }
void SetDefaultReport(IReportInfo reportInfo) { if (this.IsInDesignMode()) { return; } ExportService.SetDefaultReport(reportInfo); PrintService.SetDefaultReport(reportInfo); }
public void Execute(IReportInfo RI) { Context mContext = new Context(); mContext.RunsetAction = RunSetActionSendDataToExternalSource; mValueExpression = new ValueExpression(WorkSpace.Instance.RunsetExecutor.RunsetExecutionEnvironment, mContext, WorkSpace.Instance.SolutionRepository.GetAllRepositoryItems <DataSourceBase>()); if (!string.IsNullOrEmpty(RunSetActionSendDataToExternalSource.RequestBodyJson)) { mValueExpression.Value = RunSetActionSendDataToExternalSource.RequestBodyJson; } else { mValueExpression.Value = RequestBodyWithParametersToJson(); } string JsonOutput = mValueExpression.ValueCalculated; Reporter.ToStatus(eStatusMsgKey.PublishingToCentralDB, null, "Sending Execution data to External Source"); RestClient restClient = new RestClient(RunSetActionSendDataToExternalSource.EndPointUrl); restClient.RemoteCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true; RestRequest restRequest = new RestRequest(); restRequest.Method = Method.POST; restRequest.RequestFormat = RestSharp.DataFormat.Json; foreach (ActInputValue actInputValue in RunSetActionSendDataToExternalSource.RequestHeaders) { mValueExpression.Value = actInputValue.Value; restRequest.AddHeader(actInputValue.Param, mValueExpression.ValueCalculated); } restRequest.AddJsonBody(JsonOutput); try { IRestResponse response = restClient.Execute(restRequest); if (response.IsSuccessful) { Reporter.ToLog(eLogLevel.INFO, "Successfully sent data to External Source"); } else { Reporter.ToLog(eLogLevel.ERROR, "Failed to send execution data to External Source Response: " + response.Content); RunSetActionSendDataToExternalSource.Errors = "Failed to send execution data to External Source Response: " + response.Content; RunSetActionSendDataToExternalSource.Status = eRunSetActionStatus.Failed; return; } } catch (Exception ex) { Reporter.ToLog(eLogLevel.ERROR, "Exception when sending", ex); } finally { Reporter.HideStatusMessage(); } }
private void openButton_Click(object sender, EventArgs e) { if (!(this.reportList.SelectedItem is ReportItem reportItem)) { return; } this.Result = reportItem.Data; this.DialogResult = DialogResult.OK; this.Close(); }
private BusinessFlow ConvertRunSetToBF(IReportInfo reportInfo) { RunsetExecutor runSetExec = WorkSpace.Instance.RunsetExecutor; try { if (reportInfo == null) { return(null); } //Create Business Flow BusinessFlow virtualBF = new BusinessFlow(); virtualBF.Name = runSetExec.RunSetConfig.Name; virtualBF.Description = runSetExec.RunSetConfig.Description; virtualBF.Status = BusinessFlow.eBusinessFlowStatus.Unknown; virtualBF.RunStatus = runSetExec.RunSetConfig.RunSetExecutionStatus; virtualBF.Activities = new ObservableList <Activity>(); foreach (GingerRunner runSetrunner in runSetExec.Runners) { // if executor is null when run if from file if (runSetrunner.Executor is null) { runSetrunner.Executor = new GingerExecutionEngine(runSetrunner); } foreach (BusinessFlow runSetBF in runSetrunner.Executor.BusinessFlows) { ActivitiesGroup virtualAG = new ActivitiesGroup(); virtualAG.Name = runSetBF.Name; virtualAG.Description = runSetBF.Description; if (Enum.IsDefined(typeof(eActivitiesGroupRunStatus), runSetBF.RunStatus.ToString())) { virtualAG.RunStatus = (eActivitiesGroupRunStatus)Enum.Parse(typeof(eActivitiesGroupRunStatus), runSetBF.RunStatus.ToString()); } else { virtualAG.RunStatus = eActivitiesGroupRunStatus.NA; } virtualBF.AddActivitiesGroup(virtualAG); foreach (Activity runSetAct in runSetBF.Activities) { virtualBF.AddActivity(runSetAct, virtualAG); } } } return(virtualBF); } catch (Exception ex) { Reporter.ToLog(eLogLevel.ERROR, $"Failed to convert Run Set to BF for ALM Export", ex); return(null); } }
public void Print(IReportInfo report) { ICollection<IRemark> remarks = new List<IRemark>(); foreach (ICaseInfo @case in report.GetCases()) { this.PrintCaseHeader(@case); this.PrintCaseTable(report, @case, remarks); } this.PrintRemarks(remarks); this.output.Flush(); }
public void Print(IReportInfo report) { ICollection <IRemark> remarks = new List <IRemark>(); foreach (ICaseInfo @case in report.GetCases()) { this.PrintCaseHeader(@case); this.PrintCaseTable(report, @case, remarks); } this.PrintRemarks(remarks); this.output.Flush(); }
private void openButton_Click(object sender, EventArgs e) { var reportItem = reportList.SelectedItem as ReportItem; if (reportItem == null) { return; } this.Result = reportItem.Data; this.DialogResult = DialogResult.OK; this.Close(); }
protected virtual void UpdateReportCore(IReportInfo actualReportInfo) { UnsubscribeFromParametersViewModel(); this.actualReportInfo = actualReportInfo; SubscribeToParametersViewModel(); if (this.actualReportInfo == null) { DestroyReport(); } else { CreateReport(); } }
public void Execute(IReportInfo RI) { EmailOperations emailOperations = new EmailOperations(RunSetActionSendEmail.Email); RunSetActionSendEmail.Email.EmailOperations = emailOperations; //Make sure we clear in case use open the edit page twice RunSetActionSendEmail.Email.Attachments.Clear(); //for compatibility with old HTML report sent by email if (RunSetActionSendEmail.HTMLReportTemplate != RunSetActionSendEmail.eHTMLReportTemplate.FreeText) { SetBodyFromHTMLReport((ReportInfo)RI); } if (RunSetActionSendEmail.EmailAttachments != null) { foreach (EmailAttachment r in RunSetActionSendEmail.EmailAttachments) { //attach simple file if (r.AttachmentType == EmailAttachment.eAttachmentType.File) { if (System.IO.File.Exists(r.Name)) { AddAttachmentToEmail(RunSetActionSendEmail.Email, r.Name, r.ZipIt); } else { RunSetActionSendEmail.Email.Body = "ERROR: File not found: " + r.Name + Environment.NewLine + RunSetActionSendEmail.Email.Body; } } //attach report - after generating from template if (r.AttachmentType == EmailAttachment.eAttachmentType.Report) { string repFileName = null;// ReportTemplate.GenerateReport(r.Name, RI); if (repFileName != null) { AddAttachmentToEmail(RunSetActionSendEmail.Email, repFileName, r.ZipIt); } else { RunSetActionSendEmail.Email.Body = "ERROR: Report Template not found: " + r + Environment.NewLine + RunSetActionSendEmail.Email.Body; } } } } RunSetActionSendEmail.Email.EmailOperations.Send(); }
public void Execute(IReportInfo RI) { string json = WorkSpace.Instance.RunsetExecutor.CreateSummary(); string timestamp = DateTime.Now.ToString("MMddyyyy_HHmmss"); string jsonSummaryFolder = WorkSpace.Instance.Solution.SolutionOperations.ConvertSolutionRelativePath(WorkSpace.Instance.Solution.LoggerConfigurations.CalculatedLoggerFolder); if (!string.IsNullOrEmpty(WorkSpace.Instance.TestArtifactsFolder)) { jsonSummaryFolder = WorkSpace.Instance.TestArtifactsFolder; } string fileName = Path.Combine(jsonSummaryFolder, WorkSpace.Instance.RunsetExecutor.RunSetConfig.Name + "_" + timestamp + ".json.txt");//why not as .json? System.IO.File.WriteAllText(fileName, json); }
public void Execute(IReportInfo RI) { ReportInfo mRI = (ReportInfo)RI; try { if (!string.IsNullOrEmpty(RunSetActionSaveResults.SaveResultsInSolutionFolderName)) { Reporter.ToStatus(eStatusMsgKey.SaveItem, null, RunSetActionSaveResults.SaveResultsInSolutionFolderName, "Execution Summary"); string folder = Path.Combine(WorkSpace.Instance.TestArtifactsFolder, RunSetActionSaveResults.SaveResultsInSolutionFolderName); if (!Directory.Exists(folder)) { Directory.CreateDirectory(folder); } SaveBFResults(mRI, folder); Reporter.HideStatusMessage(); } if (!string.IsNullOrEmpty(RunSetActionSaveResults.SaveResultstoFolderName)) { Reporter.ToStatus(eStatusMsgKey.SaveItem, null, RunSetActionSaveResults.SaveResultstoFolderName, "Execution Summary"); SaveBFResults(mRI, RunSetActionSaveResults.SaveResultstoFolderName); Reporter.HideStatusMessage(); } //****----- condition to check each business flow ***//// if (!string.IsNullOrEmpty(RunSetActionSaveResults.SaveResultsInSolutionFolderName) || !string.IsNullOrEmpty(RunSetActionSaveResults.SaveResultstoFolderName)) { if (RunSetActionSaveResults.SaveindividualBFReport) { // } } else { RunSetActionSaveResults.Errors = "Folder path not provided"; Reporter.HideStatusMessage(); RunSetActionSaveResults.Status = RunSetActionBase.eRunSetActionStatus.Failed; } } catch (Exception ex) { RunSetActionSaveResults.Errors = "Failed: " + ex.Message; Reporter.HideStatusMessage(); RunSetActionSaveResults.Status = RunSetActionBase.eRunSetActionStatus.Failed; } }
public void Execute(IReportInfo RI) { try { ActScript act = new ActScript(); string FileName = WorkSpace.Instance.Solution.SolutionOperations.ConvertSolutionRelativePath(RunSetActionScript.ScriptFileName); VerifySolutionFloder(RunSetActionScript.SolutionFolder, FileName); act.ScriptName = FileName; act.ScriptInterpreterType = (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) ? ActScript.eScriptInterpreterType.VBS : ActScript.eScriptInterpreterType.SH; act.Execute(); } catch (Exception ex) { RunSetActionScript.Errors = ex.Message.ToString(); RunSetActionScript.Status = eRunSetActionStatus.Failed; } }
public void Execute(IReportInfo RI) { EmailOperations emailOperations = new EmailOperations(RunSetActionSendSMS.SMSEmail); RunSetActionSendSMS.SMSEmail.EmailOperations = emailOperations; //TODO: check number of chars and show err if more or update Errors field RunSetActionSendSMS.SMSEmail.IsBodyHTML = false; bool isSuccess; isSuccess = RunSetActionSendSMS.SMSEmail.EmailOperations.Send(); if (isSuccess == false) { RunSetActionSendSMS.Errors = RunSetActionSendSMS.SMSEmail.Event; Reporter.HideStatusMessage(); RunSetActionSendSMS.Status = RunSetActionBase.eRunSetActionStatus.Failed; } }
public void Execute(IReportInfo RI) { string result = string.Empty; ObservableList <BusinessFlow> bfs = new ObservableList <BusinessFlow>(); SetExportToALMConfig(); // ALM Test Set Level: if "Run Set" convert Run Set to Business flow if (PublishToALMConfig.ALMTestSetLevel == eALMTestSetLevel.RunSet) { bfs.Add(ConvertRunSetToBF(RI)); // Export Type: if eExportType.EntitiesAndResults then export Business Flow to ALM. if (PublishToALMConfig.ExportType == eExportType.EntitiesAndResults) { if (bfs.Count > 0) { TargetFrameworkHelper.Helper.ExportVirtualBusinessFlowToALM(bfs[0], PublishToALMConfig, false, eALMConnectType.Silence, PublishToALMConfig.TestSetFolderDestination, PublishToALMConfig.TestCaseFolderDestination); } else { Reporter.ToLog(eLogLevel.WARN, "Export Business Flow to ALM failed while publish results to ALM"); } } } else { foreach (BusinessFlowReport BFR in ((ReportInfo)RI).BusinessFlows) { bfs.Add((BusinessFlow)BFR.GetBusinessFlow()); } } if (!TargetFrameworkHelper.Helper.ExportBusinessFlowsResultToALM(bfs, ref result, PublishToALMConfig)) { RunSetActionPublishToQC.Errors = result; RunSetActionPublishToQC.Status = eRunSetActionStatus.Failed; } else { RunSetActionPublishToQC.Status = eRunSetActionStatus.Completed; } }
public void RunAction(IReportInfo RI) { Reporter.ToStatus(eStatusMsgKey.ExecutingRunSetAction, null, runsetActionBase.Name); try { Reporter.ToLog(eLogLevel.INFO, string.Format("--> Execution Started for {0} Operation from Type '{1}', Operation Name= '{2}', Operation ID= '{3}'", GingerDicser.GetTermResValue(eTermResKey.RunSet), runsetActionBase.Type, runsetActionBase.Name, runsetActionBase.Guid)); runsetActionBase.Status = eRunSetActionStatus.Running; runsetActionBase.Errors = null; Stopwatch st = new Stopwatch(); st.Reset(); st.Start(); runsetActionBase.Execute(RI); st.Stop(); runsetActionBase.Elapsed = st.ElapsedMilliseconds; // we change to completed only if still running and not changed to fail or soemthing else if (runsetActionBase.Status == eRunSetActionStatus.Running) { runsetActionBase.Status = eRunSetActionStatus.Completed; } Reporter.ToLog(eLogLevel.INFO, string.Format("<-- Execution Ended for {0} Operation from Type '{1}' and Name '{2}'", GingerDicser.GetTermResValue(eTermResKey.RunSet), runsetActionBase.Type, runsetActionBase.Name) + Environment.NewLine + "Details:" + Environment.NewLine + string.Format("Status= {0}", runsetActionBase.Status) + Environment.NewLine + string.Format("Errors= {0}", runsetActionBase.Errors) + Environment.NewLine + string.Format("Elapsed= {0}", runsetActionBase.Elapsed)); } catch (Exception ex) { Reporter.ToLog(eLogLevel.ERROR, string.Format("<-- Execution Failed with exception for {0} Operation from Type '{1}' and Name '{2}' Exception: " + ex.Message, GingerDicser.GetTermResValue(eTermResKey.RunSet), runsetActionBase.Type, runsetActionBase.Name), ex); runsetActionBase.Status = eRunSetActionStatus.Failed; } finally { Reporter.HideStatusMessage(); } }
public void Execute(IReportInfo RI) { string testNGReportPath = ""; try { if (!string.IsNullOrEmpty(RunSetActionGenerateTestNGReport.SaveResultsInSolutionFolderName)) { testNGReportPath = WorkSpace.Instance.Solution.SolutionOperations.ConvertSolutionRelativePath(RunSetActionGenerateTestNGReport.SaveResultsInSolutionFolderName); } else if (!string.IsNullOrEmpty(amdocs.ginger.GingerCoreNET.WorkSpace.Instance.TestArtifactsFolder)) { testNGReportPath = amdocs.ginger.GingerCoreNET.WorkSpace.Instance.TestArtifactsFolder; } else { testNGReportPath = WorkSpace.Instance.Solution.SolutionOperations.ConvertSolutionRelativePath(WorkSpace.Instance.Solution.LoggerConfigurations.CalculatedLoggerFolder); } if (!Directory.Exists(testNGReportPath)) { try { Directory.CreateDirectory(testNGReportPath); } catch (Exception ex) { testNGReportPath = WorkSpace.Instance.Solution.SolutionOperations.ConvertSolutionRelativePath(WorkSpace.Instance.Solution.LoggerConfigurations.CalculatedLoggerFolder); } } SaveBFResults((ReportInfo)RI, testNGReportPath, RunSetActionGenerateTestNGReport.IsStatusByActivitiesGroup); } catch (Exception ex) { RunSetActionGenerateTestNGReport.Errors = ex.Message.ToString(); RunSetActionGenerateTestNGReport.Status = eRunSetActionStatus.Failed; } }
public void Execute(IReportInfo RI) { EmailOperations emailOperations = new EmailOperations(RunSetActionSendFreeEmail.Email); RunSetActionSendFreeEmail.Email.EmailOperations = emailOperations; RunSetActionSendFreeEmail.Email.Attachments.Clear(); RunSetActionSendFreeEmail.Email.EmailOperations.alternateView = null; mVE.Value = RunSetActionSendFreeEmail.MailFrom; RunSetActionSendFreeEmail.Email.MailFrom = mVE.ValueCalculated; mVE.Value = RunSetActionSendFreeEmail.MailFromDisplayName; RunSetActionSendFreeEmail.Email.MailFromDisplayName = mVE.ValueCalculated; mVE.Value = RunSetActionSendFreeEmail.MailTo; RunSetActionSendFreeEmail.Email.MailTo = mVE.ValueCalculated; mVE.Value = RunSetActionSendFreeEmail.MailCC; RunSetActionSendFreeEmail.Email.MailCC = mVE.ValueCalculated; mVE.Value = RunSetActionSendFreeEmail.Subject; RunSetActionSendFreeEmail.Email.Subject = mVE.ValueCalculated; mVE.Value = RunSetActionSendFreeEmail.Bodytext; RunSetActionSendFreeEmail.Email.Body = mVE.ValueCalculated; mVE.Value = RunSetActionSendFreeEmail.MailHost; RunSetActionSendFreeEmail.Email.SMTPMailHost = mVE.ValueCalculated; mVE.Value = RunSetActionSendFreeEmail.MailUser; RunSetActionSendFreeEmail.Email.SMTPUser = mVE.ValueCalculated; bool isSuccess; isSuccess = RunSetActionSendFreeEmail.Email.EmailOperations.Send(); if (isSuccess == false) { RunSetActionSendFreeEmail.Errors = RunSetActionSendFreeEmail.Email.Event; Reporter.HideStatusMessage(); RunSetActionSendFreeEmail.Status = RunSetActionBase.eRunSetActionStatus.Failed; } }
private void PrintCaseTable(IReportInfo report, ICaseInfo @case, ICollection<IRemark> remarks) { this.PrintCaseTableHeader(@case); this.PrintCaseTableContent(report, @case, remarks); this.PrintCaseTableFooter(); }
public override void Execute(IReportInfo RI) { RunSetActionGenerateTestNGReportOperations.Execute(RI); }
public void Visit(ResearchReport report) { wrapped = new ResearchReportInfo(report); }
public void Visit(DevelopmentReport report) { wrapped = new DevelopmentReportInfo(report); }
protected override void UpdateReportCore(IReportInfo actualReportInfo) { base.UpdateReportCore(actualReportInfo); BackstageItem.IsEnabled = actualReportInfo != null; }
protected override void ShowReport(IReportInfo reportInfo) { base.ShowReport(reportInfo); Dispatcher.BeginInvoke((Action)OpenBackstageView); }
public bool ShowItem(IReportInfo report) { report.Accept(this); return(this.show); }
void ShowReport(IReportInfo reportInfo, string reportId) { ExportService.ShowReport(reportInfo); PrintService.ShowReport(reportInfo); }
void ShowReport(IReportInfo reportInfo, string reportId) { ExportService.ShowReport(reportInfo); PrintService.ShowReport(reportInfo); Logger.Log(string.Format("OutlookInspiredApp: Create Report : User: {0}", reportId)); }
private void PrintCaseTable(IReportInfo report, ICaseInfo @case, ICollection <IRemark> remarks) { this.PrintCaseTableHeader(@case); this.PrintCaseTableContent(report, @case, remarks); this.PrintCaseTableFooter(); }
public override void Execute(IReportInfo RI) { RunSetActionHTMLReportOperations.Execute(RI); }
public override void Execute(IReportInfo RI) { RunSetActionSendFreeEmailOperations.Execute(RI); }
public ReportThumbnailVisitor(IReportInfo report) { this.Result = null; report.Accept(this); }