Inheritance: NUnitGoCore.CustomElements.HtmlCustomElements.HtmlBaseElement
示例#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");
            }
        }
示例#2
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");
     }
 }