Example #1
0
        private void CustomHTMLReportComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            BodyWebBrowser.Visibility = System.Windows.Visibility.Visible;
            ReportInfo RI   = new ReportInfo(WorkSpace.Instance.RunsetExecutor.RunsetExecutionEnvironment, WorkSpace.Instance.RunsetExecutor);
            string     html = String.Empty;

            if (CustomHTMLReportComboBox.SelectedItem == null)
            {
                return;
            }

            ObservableList <HTMLReportTemplate> HTMLReportTemplates = WorkSpace.Instance.SolutionRepository.GetAllRepositoryItems <HTMLReportTemplate>();

            foreach (HTMLReportTemplate htr in HTMLReportTemplates)
            {
                if (htr.Name == CustomHTMLReportComboBox.SelectedItem.ToString())
                {
                    html = htr.HTML;
                }
            }

            HTMLReportPage HTP = new HTMLReportPage(RI, html);

            BodyWebBrowser.NavigateToString(HTP.HTML);
        }
Example #2
0
        public void SetBodyFromHTMLReport(ReportInfo RI)
        {
            HTMLReportBase HRB = null;

            switch (HTMLReportTemplate)
            {
            case eHTMLReportTemplate.Detailed:
                HRB = new HTMLDetailedReport();
                break;

            case eHTMLReportTemplate.Summary:
                HRB = new HTMLSummaryReport();
                break;

            case eHTMLReportTemplate.Plain:
                HRB = new HTMLPlainReport();
                break;

            case eHTMLReportTemplate.Custom:

                string html = String.Empty;

                HTMLReportTemplate HTMLR = new HTMLReportTemplate();
                ObservableList <HTMLReportTemplate> HTMLReports = WorkSpace.Instance.SolutionRepository.GetAllRepositoryItems <HTMLReportTemplate>();
                foreach (HTMLReportTemplate HT in HTMLReports)
                {
                    if (HT.Name == CustomHTMLReportTemplate)
                    {
                        html  = HT.HTML;
                        HTMLR = HT;
                    }
                }

                HTMLReportPage HTP = new HTMLReportPage(RI, html);

                Email.Body = HTP.HTML;

                return;
                // break;
            }

            if (HRB != null)
            {
                Email.Body = HRB.CreateReport(RI);
                CustomHTMLReportTemplate = String.Empty;
            }
            else
            {
                throw new Exception("Unknown HTML Report type - " + HTMLReportTemplate.ToString());
            }
        }
Example #3
0
        private void CustomHTMLReportComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            BodyWebBrowser.Visibility = System.Windows.Visibility.Visible;
            ReportInfo RI   = new ReportInfo(App.RunsetExecutor.RunsetExecutionEnvironment, App.RunsetExecutor);
            string     html = String.Empty;

            if (CustomHTMLReportComboBox.SelectedItem == null)
            {
                return;
            }

            foreach (HTMLReportTemplate htr in App.LocalRepository.GetSolutionHTMLReportTemplates())
            {
                if (htr.Name == CustomHTMLReportComboBox.SelectedItem.ToString())
                {
                    html = htr.HTML;
                }
            }

            HTMLReportPage HTP = new HTMLReportPage(RI, html);

            BodyWebBrowser.NavigateToString(HTP.HTML);
        }
Example #4
0
        public static HTMLReportPage GetSampleReportPage(string Xaml)
        {
            BusinessFlow BF1 = new BusinessFlow()
            {
                Name = "BF1 - Create Customer", Description = "Create any type of customer: Business/Residential..."
            };

            BF1.Active     = true;
            BF1.RunStatus  = Amdocs.Ginger.CoreNET.Execution.eRunStatus.Passed;
            BF1.Activities = new ObservableList <Activity>();
            BF1.Elapsed    = 2364;

            //Activity 1
            Activity a1 = new Activity()
            {
                ActivityName = "Launch Application & Login", Status = Amdocs.Ginger.CoreNET.Execution.eRunStatus.Passed
            };

            BF1.Activities.Add(a1);

            ActGotoURL act1 = new ActGotoURL()
            {
                Description = "Goto URL www.abcd.com", Status = Amdocs.Ginger.CoreNET.Execution.eRunStatus.Passed, Elapsed = 3124
            };

            a1.Acts.Add(act1);

            ActReturnValue ARV1 = new ActReturnValue();

            ARV1.Param    = "RC";
            ARV1.Expected = "123";
            ARV1.Actual   = "123";
            ARV1.Status   = ActReturnValue.eStatus.Passed;
            act1.ReturnValues.Add(ARV1);
            ActTextBox act2 = new ActTextBox()
            {
                Description = "Enter User ID", Status = Amdocs.Ginger.CoreNET.Execution.eRunStatus.Passed, Elapsed = 230
            };
            // Add sample screen shot
            Bitmap tempBmp = new Bitmap(Ginger.Properties.Resources.ScreenShot1);

            act2.ScreenShots.Add(GingerCore.General.BitmapImageToFile(tempBmp));

            a1.Acts.Add(act2);

            ActTextBox act3 = new ActTextBox()
            {
                Description = "Enter Password", Status = Amdocs.Ginger.CoreNET.Execution.eRunStatus.Passed, Elapsed = 112
            };

            a1.Acts.Add(act3);

            ActSubmit act4 = new ActSubmit()
            {
                Description = "Click Submit Button", Status = Amdocs.Ginger.CoreNET.Execution.eRunStatus.Passed, Elapsed = 1282
            };

            a1.Acts.Add(act4);

            //Activity 2
            Activity a2 = new Activity()
            {
                ActivityName = "Create New customer", Status = Amdocs.Ginger.CoreNET.Execution.eRunStatus.Failed
            };

            BF1.Activities.Add(a2);

            ActTextBox acta21 = new ActTextBox()
            {
                Description = "Enter First Name", Status = Amdocs.Ginger.CoreNET.Execution.eRunStatus.Passed, Elapsed = 325
            };

            a2.Acts.Add(acta21);

            ActTextBox acta22 = new ActTextBox()
            {
                Description = "Enter Last Name", Status = Amdocs.Ginger.CoreNET.Execution.eRunStatus.Passed, Elapsed = 302
            };

            a2.Acts.Add(acta22);

            ActTextBox acta23 = new ActTextBox()
            {
                Description = "Enter City", Status = Amdocs.Ginger.CoreNET.Execution.eRunStatus.Failed, Elapsed = 820, Error = "Error: Element not found by ID 'City'", ExInfo = "Cannot find element"
            };

            a2.Acts.Add(acta23);

            ActSubmit acta24 = new ActSubmit()
            {
                Description = "Click Create Button", Status = Amdocs.Ginger.CoreNET.Execution.eRunStatus.Pending
            };

            a2.Acts.Add(acta24);

            //Add Variables
            BF1.Variables = new ObservableList <VariableBase>();

            VariableString v1 = new VariableString()
            {
                Name = "FirstName", Value = "David Smith"
            };

            BF1.Variables.Add(v1);

            VariableRandomNumber v2 = new VariableRandomNumber()
            {
                Name = "Random 1", Min = 1, Max = 100, Value = "55"
            };

            BF1.Variables.Add(v2);

            //Add a few simple BFs
            BusinessFlow BF2 = new BusinessFlow()
            {
                Name = "BF2 - Customer Order Product", Description = "", Active = true
            };

            BF2.Activities = new ObservableList <Activity>();
            BF2.RunStatus  = Amdocs.Ginger.CoreNET.Execution.eRunStatus.Failed;
            BF2.Elapsed    = 1249;

            ProjEnvironment env = new ProjEnvironment()
            {
                Name = "Env1"
            };
            //TODO: add more env info

            //cretae dummy GR, GMR
            RunsetExecutor GMR = new RunsetExecutor();

            GingerRunner GR = new GingerRunner();

            GR.BusinessFlows.Add(BF1);
            GR.BusinessFlows.Add(BF2);
            GR.CurrentSolution = WorkSpace.UserProfile.Solution;
            GMR.Runners.Add(GR);

            ReportInfo     RI = new ReportInfo(env, GMR);
            HTMLReportPage RP = new HTMLReportPage(RI, Xaml);

            return(RP);
        }
Example #5
0
 private void LoadReportTemplatePage()
 {
     mReportPage = GetSampleReportPage(mReportTemplate.HTML);
     BodyWebBrowser.NavigateToString(mReportPage.HTML);
 }