SavePage() public method

public SavePage ( string fullpath ) : void
fullpath string
return void
Ejemplo n.º 1
0
        public static void GenerateTestPage(this NunitGoTest nunitGoTest, string fullPath, string testOutput, string chartFile)
        {
            try
            {
                const string script   = @"
					$(document).ready(function() {
						$("".tabs-menu a"").click(function(event) {
							event.preventDefault();
							$(this).parent().addClass(""current"");
							$(this).parent().siblings().removeClass(""current"");
							var tab = $(this).attr(""href"");
							$("".tab-content"").not(tab).css(""display"", ""none"");
							$(tab).fadeIn();
						});
					});
				"                ;
                var          htmlTest = new NunitTestHtml.NunitTestHtml(nunitGoTest, testOutput);
                var          page     = new HtmlPage("Test page")
                {
                    PageStylePaths = new List <string>
                    {
                        "./../../" + Output.Files.ReportStyleFile,
                        "./../../" + Output.Files.PrimerStyleFile
                    },
                    PageScriptString = script,
                    ScriptFilePaths  = new List <string>
                    {
                        "./../../" + Output.Files.JQueryScriptFile,
                        Output.Files.HighstockScriptFile,
                        chartFile
                    },
                    PageBodyCode = htmlTest.HtmlCode
                };
                page.SavePage(fullPath);
            }
            catch (Exception ex)
            {
                Log.Exception(ex, "Exception while generating test html page");
            }
        }
Ejemplo n.º 2
0
 public static void GenerateMainStatisticsPage(this MainStatistics stats, string fullPath)
 {
     try
     {
         var reportMenuTitle   = new SectionName("Main statistics");
         var statisticsSection = new StatisticsSection(stats);
         var page = new HtmlPage("Main statistics page")
         {
             PageStylePaths = new List <string>
             {
                 Output.Files.ReportStyleFile,
                 Output.Files.PrimerStyleFile
             },
             PageBodyCode = reportMenuTitle.HtmlCode + statisticsSection.HtmlCode
         };
         page.SavePage(fullPath);
     }
     catch (Exception ex)
     {
         Log.Exception(ex, "Exception while generating main statistics page");
     }
 }
Ejemplo n.º 3
0
 public static void GenerateTimelinePage(this List <NunitGoTest> tests, string fullPath)
 {
     try
     {
         var reportMenuTitle = new SectionName("Tests timeline");
         var timeline        = new TimelineSection(tests);
         var page            = new HtmlPage("Timeline page")
         {
             PageStylePaths = new List <string>
             {
                 Output.Files.ReportStyleFile,
                 Output.Files.PrimerStyleFile
             },
             PageBodyCode = reportMenuTitle.HtmlCode + timeline.HtmlCode
         };
         page.SavePage(fullPath);
     }
     catch (Exception ex)
     {
         Log.Exception(ex, "Exception while generating timeline page");
     }
 }
Ejemplo n.º 4
0
 public static void GenerateMainStatisticsPage(this MainStatistics stats, string fullPath)
 {
     try
     {
         var reportMenuTitle = new SectionName("Main statistics");
         var statisticsSection = new StatisticsSection(stats);
         var page = new HtmlPage("Main statistics page")
         {
             PageStylePaths = new List<string>
             {
                 Output.Files.ReportStyleFile,
                 Output.Files.PrimerStyleFile
             },
             PageBodyCode = reportMenuTitle.HtmlCode + statisticsSection.HtmlCode
         };
         page.SavePage(fullPath);
     }
     catch (Exception ex)
     {
         Log.Exception(ex, "Exception while generating main statistics page");
     }
 }
Ejemplo n.º 5
0
 public static void GenerateReportMainPage(this List <NunitGoTest> tests,
                                           string pathToSave, MainStatistics mainStats)
 {
     try
     {
         var menuElements = new List <ReportMenuItem>
         {
             new ReportMenuItem("Main statistics", Output.Files.TestStatisticsFile, "octicon octicon-graph"),
             new ReportMenuItem("Test list", Output.Files.TestListFile, "octicon octicon-checklist"),
             new ReportMenuItem("Timeline", Output.Files.TimelineFile, "octicon octicon-clock")
         };
         var mainTitle       = new SectionName("Test Run Report");
         var mainInformation = new MainInformationSection(mainStats);
         var reportMenu      = new MenuSection(menuElements, "main-menu", "Report menu");
         var report          = new HtmlPage("NUnitGo Report")
         {
             ScriptFilePaths = new List <string>
             {
                 Output.Files.JQueryScriptFile,
                 Output.Files.HighstockScriptFile,
                 Output.Files.StatsScript
             },
             PageStylePaths = new List <string>
             {
                 Output.Files.ReportStyleFile,
                 Output.Files.PrimerStyleFile,
                 Output.Files.OcticonStyleFile
             },
             PageBodyCode = mainTitle.HtmlCode + mainInformation.HtmlCode + reportMenu.ReportMenuHtml
         };
         report.SavePage(Path.Combine(pathToSave, Output.Files.FullReportFile));
     }
     catch (Exception ex)
     {
         Log.Exception(ex, "Exception while generating full report page");
     }
 }
Ejemplo n.º 6
0
        public static void GenerateReportMainPage(this List<NunitGoTest> tests, 
			string pathToSave, MainStatistics mainStats)
        {
            try
            {
                var menuElements = new List<ReportMenuItem>
                {
                    new ReportMenuItem("Main statistics", Output.Files.TestStatisticsFile , "octicon octicon-graph"),
                    new ReportMenuItem("Test list", Output.Files.TestListFile, "octicon octicon-checklist"),
                    new ReportMenuItem("Timeline", Output.Files.TimelineFile, "octicon octicon-clock")
                };
                var mainTitle = new SectionName("Test Run Report");
                var mainInformation = new MainInformationSection(mainStats);
                var reportMenu = new MenuSection(menuElements, "main-menu", "Report menu");
                var report = new HtmlPage("NUnitGo Report")
                {
                    ScriptFilePaths = new List<string>
                    {
                        Output.Files.JQueryScriptFile,
                        Output.Files.HighstockScriptFile,
                        Output.Files.StatsScript
                    },
                    PageStylePaths = new List<string>
                    {
                        Output.Files.ReportStyleFile,
                        Output.Files.PrimerStyleFile,
                        Output.Files.OcticonStyleFile
                    },
                    PageBodyCode = mainTitle.HtmlCode + mainInformation.HtmlCode + reportMenu.ReportMenuHtml
                };
                report.SavePage(Path.Combine(pathToSave, Output.Files.FullReportFile));
            }
            catch (Exception ex)
            {
                Log.Exception(ex, "Exception while generating full report page");
            }
        }
Ejemplo n.º 7
0
 public static void GenerateTestListPage(this List<NunitGoTest> tests, string fullPath)
 {
     try
     {
         var reportMenuTitle = new SectionName("Test list");
         var testListSection = new TestListSection(tests);
         var page = new HtmlPage("Test list page")
         {
             PageStylePaths = new List<string>
             {
                 Output.Files.ReportStyleFile,
                 Output.Files.PrimerStyleFile,
                 Output.Files.OcticonStyleFile
             },
             PageBodyCode = reportMenuTitle.HtmlCode + testListSection.HtmlCode
         };
         page.SavePage(fullPath);
     }
     catch (Exception ex)
     {
         Log.Exception(ex, "Exception while generating test list page");
     }
 }
Ejemplo n.º 8
0
 public static void GenerateTestPage(this NunitGoTest nunitGoTest, string fullPath, string testOutput, string chartFile)
 {
     try
     {
         const string script = @"
             $(document).ready(function() {
                 $("".tabs-menu a"").click(function(event) {
                     event.preventDefault();
                     $(this).parent().addClass(""current"");
                     $(this).parent().siblings().removeClass(""current"");
                     var tab = $(this).attr(""href"");
                     $("".tab-content"").not(tab).css(""display"", ""none"");
                     $(tab).fadeIn();
                 });
             });
         ";
         var htmlTest = new NunitTestHtml.NunitTestHtml(nunitGoTest, testOutput);
         var page = new HtmlPage("Test page")
         {
             PageStylePaths = new List<string>
             {
                 "./../../" + Output.Files.ReportStyleFile,
                 "./../../" + Output.Files.PrimerStyleFile
             },
             PageScriptString = script,
             ScriptFilePaths = new List<string>
             {
                 "./../../" + Output.Files.JQueryScriptFile,
                 Output.Files.HighstockScriptFile,
                 chartFile
             },
             PageBodyCode = htmlTest.HtmlCode
         };
         page.SavePage(fullPath);
     }
     catch (Exception ex)
     {
         Log.Exception(ex, "Exception while generating test html page");
     }
 }