コード例 #1
0
        public static void CreateReport()
        {
            var htmlReporter = new ExtentHtmlReporter(pathToReport + reportName + DateTime.Now.ToString("dd-MM-yyyy") + ".html");
            var KlovManager  = ConfigurationManager.AppSettings["EnableKlov"];

            // create ExtentReports and attach reporter(s)
            extent = new ExtentReports();

            if (KlovManager == "True")
            {
                klov = new KlovReporter();

                var klovUrlConnection  = ConfigurationManager.AppSettings["klovUrl"];
                var klovPortConnection = ConfigurationManager.AppSettings["klovPort"];
                var klovProjectName    = NunitTestHelper.GetProjectName();
                var KlovManagerUrl     = ConfigurationManager.AppSettings["KlovManagerUrl"];

                klov.InitMongoDbConnection(klovUrlConnection, int.Parse(klovPortConnection));

                klov.ProjectName = NunitTestHelper.GetProjectName();

                klov.KlovUrl = KlovManagerUrl;

                klov.ReportName = "Build " + DateTime.Now.ToString();
                extent.AttachReporter(htmlReporter, klov);
            }
            else
            {
                extent.AttachReporter(htmlReporter);
            }


            //extent.AttachReporter(htmlReporter);
        }
コード例 #2
0
        public static void AddTest()
        {
            var testName    = NunitTestHelper.GetTestName();
            var description = NunitTestHelper.GetTestAttribute("Description");
            var className   = NunitTestHelper.GetClassName();
            var category    = NunitTestHelper.GetTestAttribute("Category");

            // creates a toggle for the given test, adds all log events under it
            test = extent.CreateTest(testName, description).AssignCategory(category);
        }