コード例 #1
0
        public static void InitializeReport()
        {
            _logs = new List <string>();

            _report = new ReportLogs
            {
                Name = "Trade Me Sandbox Test Automation"
            };

            var reportsFilenamePrefix = "Trade Me Sandbox";

            var reportsDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Reports");

            if (!Directory.Exists(reportsDirectory))
            {
                Directory.CreateDirectory(reportsDirectory);
            }

            var reportsFilename = $"{reportsFilenamePrefix}_{DateTime.Now:yyyyMMdd_HHmmss}_Test Automation.html";

            var reportsPath = Path.Combine(reportsDirectory, reportsFilename);

            _v3HtmlReporter = new ExtentV3HtmlReporter(reportsPath);

            _v3HtmlReporter.LoadConfig(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "extent-config.xml"));

            _v3HtmlReporter.Start();

            _extent = new ExtentReports();

            _extent.AttachReporter(_v3HtmlReporter);
        }
コード例 #2
0
        public void TestMethod()
        {
            //To create report object
            var htmlReporter = new ExtentV3HtmlReporter("E:\\" + this.GetType().Name + ".html");
            var extent       = new ExtentReports();

            extent.AttachReporter(htmlReporter);
            ExtentTest testlog;
            ExtentTest childLog;

            testlog = extent.CreateTest("Test log with Child nodes");
            testlog.Log(Status.Info, MarkupHelper.CreateLabel("This is Info log", ExtentColor.Orange));
            testlog.Log(Status.Pass, MarkupHelper.CreateLabel("This is pass log", ExtentColor.Cyan));

            //Child test node to integrate with Parent test
            childLog = testlog.CreateNode("Childnode-1");
            childLog.Info("This is Info log");
            childLog.Pass("This is Pass log");
            childLog.Fail("This is Fail log");

            childLog = childLog.CreateNode("Childnode-2");
            childLog.Info("This is Info log");
            childLog.Pass("This is Pass log");

            childLog = testlog.CreateNode("Childnode-3");
            childLog.Info("This is Info log");
            childLog.Pass("This is Pass log");
            childLog.Warning("This is Warning log");

            extent.Flush();
        }
コード例 #3
0
        public static void BeforeExecution()

        {
            switch (ValidateGenerateReport)
            {
            case "true":
                if (!Directory.Exists(BaseReportFolder))
                {
                    Directory.CreateDirectory(BaseReportFolder);
                }

                if (!Directory.Exists(ReportFolder))
                {
                    Directory.CreateDirectory(ReportFolder);
                }

                var htmlReporter = new ExtentV3HtmlReporter(ReportFolder + @"\ReportTest_" + Date + ".html");

                htmlReporter.Config.Theme = AventStack.ExtentReports.Reporter.Configuration.Theme.Dark;

                extent = new ExtentReports();

                extent.AttachReporter(htmlReporter);
                break;

            case "false":
                break;

            default:
                Assert.Fail("Incorrect condition" + ValidateGenerateReport + ". suggestion(true or false)");
                break;
            }
        }
コード例 #4
0
        public void ExtentStart()
        {
            extent = new ExtentReports();
            var htmlReporter = new ExtentV3HtmlReporter(@"C:\Users\bryar.h.cole\Desktop\AutomationProvjects\NUnit.Tests1\Reports\HIPPSubmitMember\index.html");

            extent.AttachReporter(htmlReporter);
        }
コード例 #5
0
        //Creating the extent report instance
        protected void createReportInstance()
        {
            if (_extentReports == null)
            {
                hmtlreport = DateTime.Now.ToString("dd_MM_yyyy_HH_mm_ss");

                string reportname = _configProperties["reportName"] + hmtlreport + ".html";

                string _reportPath = Directory.GetParent(AppDomain.CurrentDomain.BaseDirectory).Parent.Parent.FullName;

                _reportPath = _reportPath + "/ExtentReport/Reports/" + hmtlreport + "/" + reportname;

                _extentReports = new ExtentReports();

                _htmlReporter = new ExtentV3HtmlReporter(_reportPath);

                string _testerName = System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString().Split('\\')[1].ToString();

                _extentReports.AttachReporter(_htmlReporter);

                _extentReports.AddSystemInfo("Reporter name", _testerName);

                _extentReports.AddSystemInfo("Environment", _configProperties["environment"].ToString());

                _extentReports.AddSystemInfo("username", _testerName);

                _extentReports.AddSystemInfo("Location", _configProperties["Location"].ToString());

                _htmlReporter.LoadConfig(Directory.GetParent(AppDomain.CurrentDomain.BaseDirectory).Parent.Parent.FullName + "/Configuration/extent-config.xml");
            }
        }
        public void TestMethod()
        {
            //To create report object
            var htmlReporter = new ExtentV3HtmlReporter("E:\\" + this.GetType().Name + ".html");
            var extent       = new ExtentReports();

            extent.AttachReporter(htmlReporter);
            ExtentTest testlog;

            //Represents HTML log
            testlog = extent.CreateTest("Test Log Method-2", "<br/>"
                                        + "Lorem Ipsum is simply dummy text of the printing and typesetting industry." + "<br/><br/>"
                                        + "<b>Where can I get some?</b>" + "<br/>"
                                        + "There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable.");
            testlog.Log(Status.Info, "This is Info log");
            testlog.Log(Status.Pass, "This is Pass log");
            testlog.Log(Status.Fail, "This is Fail log");

            testlog = extent.CreateTest("Test log with Extent Color");
            testlog.Log(Status.Info, MarkupHelper.CreateLabel("This is Info log", ExtentColor.Orange));
            testlog.Log(Status.Pass, MarkupHelper.CreateLabel("This is pass log", ExtentColor.Cyan));

            //If flush method did not call, Report will not generate.
            extent.Flush();
        }
コード例 #7
0
        public static void BeforeTestRun()
        {
            //Check and backup current test report then clear files in test report folder
            try
            {
                if (FrameworkUtility.CheckIfFolderContainsFiles(FrameworkUtility.GetTestReportDirectory(), "html"))
                {
                    FrameworkUtility.ZipFolderLocation(FrameworkUtility.GetTestReportDirectory(), FrameworkUtility.GetTestReportBackUpDirectory() + "TestReport" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + ".zip");
                    FrameworkUtility.DeleteAllFilesInFolder(FrameworkUtility.GetTestReportDirectory());
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            //Create extent report object
            extentReports = new ExtentReports();
            //Create html reporter object and define reporter path
            var htmlReporter = new ExtentV3HtmlReporter(FrameworkUtility.GetTestReportDirectory() + "TestResultsReport.html");

            //Adding html reporter to extent report object
            extentReports.AttachReporter(htmlReporter);
            extentReports.CreateTest("IGNORE");
            extentReports.AddSystemInfo("Host Name", "Local");
            extentReports.AddSystemInfo("Environment", "Local");
            htmlReporter.LoadConfig(FrameworkUtility.GetProjectBaseDirectory() + @"\extent-config.xml");

            //Create extent log object
            extentLog = new ExtentReports();
            var htmlLogger = new ExtentLoggerReporter(FrameworkUtility.GetTestReportDirectory());

            htmlLogger.LoadConfig(FrameworkUtility.GetProjectBaseDirectory() + @"\extent-config.xml");
            extentLog.AttachReporter(htmlLogger);
        }
コード例 #8
0
        public ExtentReports getReport()
        {
            string reportPath = ReportingHelpers.reportpath();
            string timeNow    = DateTime.Now.ToLongTimeString().ToString().Replace(':', '_');

            //initialize the reportsetup
            htmlreportPath = reportPath + @"\" + "RunResult_" + timeNow + ".html";

            Logger.log("HTML Report Path" + htmlreportPath);
            var htmlReporter = new ExtentV3HtmlReporter(htmlreportPath);

            var extent = new ExtentReports();

            extent.AttachReporter(htmlReporter);
            // adding environment variables

            string machineName = Environment.MachineName;
            string systemOS    = Environment.OSVersion.ToString();

            extent.AddSystemInfo("Machine Name", machineName);

            extent.AddSystemInfo("Operating System", systemOS);



            return(extent);
        }
コード例 #9
0
        /// <summary>
        /// Initailize all the necessary configuration for reporting
        /// </summary>
        public void InitReporting()
        {
            extentHtmlReporter = new  ExtentV3HtmlReporter(BDDReports.ReportFilePath);

            //initialize ExtentReports and attach the HtmlReporter
            extentRprt = new ExtentReports();
            extentRprt.AttachReporter(extentHtmlReporter);

            //To add system or environment info by using the setSystemInfo method.
            extentRprt.AddSystemInfo("Domain Name", Environment.UserDomainName);
            extentRprt.AddSystemInfo("OS  Platform", System.Environment.OSVersion.Platform.ToString());
            extentRprt.AddSystemInfo("OS  Version", System.Environment.OSVersion.ToString());
            extentRprt.AddSystemInfo("Machine Name", Environment.MachineName);
            extentRprt.AddSystemInfo("User Name", Environment.UserName);


            //set BDD report Style
            extentRprt.AnalysisStrategy = AnalysisStrategy.BDD;
            extentRprt.GherkinDialect   = "de";

            //configuration items to change the look and feel
            //add content, manage tests etc
            extentHtmlReporter.Config.DocumentTitle = BDDReports.ReportTitle;
            extentHtmlReporter.AnalysisStrategy     = AnalysisStrategy.Test;

            extentHtmlReporter.Start();
            extentHtmlReporter.Config.ReportName     = BDDReports.ReportDocName;
            extentHtmlReporter.Config.EnableTimeline = true;
            extentHtmlReporter.Config.Theme          = AventStack.ExtentReports.Reporter.Configuration.Theme.Dark;

            // Create Report featue and scenario
            extentFeature  = extentRprt.CreateTest <Feature>(BDDReports.ReportFeatureContext.FeatureInfo.Title);
            extentScenario = extentFeature.CreateNode <Scenario>(BDDReports.ReportScenarioContext.ScenarioInfo.Title);
        }
コード例 #10
0
        public ExtentReportHelper()
        {
            reportFullPath = $"{reportsPath}TestReport_{DateHelper.GetNowDateTimeAsString()}.html";
            htmlReporter   = new ExtentV3HtmlReporter(reportFullPath);

            extent.AttachReporter(htmlReporter);
            SetReportSystemInfo();
        }
コード例 #11
0
        public static void InitializeReport()
        {
            var htmlReporter = new ExtentV3HtmlReporter(Utilities.TestResultFolder + "ExtentReport.html");

            htmlReporter.Config.Theme = Theme.Dark;
            extent = new ExtentReports();
            extent.AttachReporter(htmlReporter);
        }
コード例 #12
0
        public static void ReportGenerator()
        {
            var testResultReport = new ExtentV3HtmlReporter(Directory.GetCurrentDirectory() + @"\TestResult.html");

            testResultReport.Config.Theme = AventStack.ExtentReports.Reporter.Configuration.Theme.Dark;
            report = new ExtentReports();
            report.AttachReporter(testResultReport);
        }
コード例 #13
0
        public static void InitializeReport()
        {
            var htmlReporter = new ExtentV3HtmlReporter(@"C:\Reports\FinalReport.html");

            htmlReporter.Config.Theme      = AventStack.ExtentReports.Reporter.Configuration.Theme.Dark;
            htmlReporter.Config.ReportName = "Report test" + DateTime.Now;
            report = new AventStack.ExtentReports.ExtentReports();
            report.AttachReporter(htmlReporter);
        }
コード例 #14
0
        protected void Setup()
        {
            string dir      = TestContext.CurrentContext.TestDirectory + "\\";
            var    fileName = this.GetType().ToString() + ".html";
            ExtentV3HtmlReporter htmlReporter = new ExtentV3HtmlReporter(dir + fileName);

            _extent = new ExtentReports();
            _extent.AttachReporter(htmlReporter);
        }
コード例 #15
0
        static ExtentService()
        {
            var htmlReporter = new ExtentV3HtmlReporter(TestContext.CurrentContext.TestDirectory + "\\AutomationPractice.html");

            htmlReporter.Config.DocumentTitle = "Extent/Automation Practice";
            htmlReporter.Config.ReportName    = "Extent/Automation Practice";
            htmlReporter.Config.Theme         = Theme.Standard;
            Instance.AttachReporter(htmlReporter);
        }
        public void GetExtentOptions()
        {
            // this.browser = browser;
            Console.WriteLine("Entered the extent method for: " + browser);

            switch (browser)
            {
            case "chrome":
                ExtentV3HtmlReporter htmlReporter = new ExtentV3HtmlReporter(@"C:\Users\Ashrith\source\repos\SeleniumFramwork\SeleniumFramwork\Reports\chrome\Extentreport-" + timeStamp + ".html");
                sourceFile = @"C:\Users\Ashrith\source\repos\SeleniumFramwork\SeleniumFramwork\Reports\chrome\Extentreport" + timeStamp + ".html";
                System.IO.FileInfo fi = new System.IO.FileInfo(sourceFile);
                if (fi.Exists)
                {
                    fi.MoveTo(@"C:\Users\Ashrith\source\repos\SeleniumFramwork\SeleniumFramwork\Reports\chrome\Extentreport-" + timeStamp + ".html");

                    Console.WriteLine(" Chrome File Renamed!!");
                }

                Console.WriteLine("The Extent Report is generated in chrome folder.");
                break;

            case "ie":
                htmlReporter = new ExtentV3HtmlReporter(@"C:\Users\Ashrith\source\repos\SeleniumFramwork\SeleniumFramwork\Reports\ie\index.html");
                sourceFile   = @"C:\Users\Ashrith\source\repos\SeleniumFramwork\SeleniumFramwork\Reports\ie\index" + timeStamp + ".html";
                fi           = new System.IO.FileInfo(sourceFile);
                if (fi.Exists)
                {
                    fi.MoveTo(@"C:\Users\Ashrith\source\repos\SeleniumFramwork\SeleniumFramwork\Reports\ie\Extentreport-" + timeStamp + ".html");

                    Console.WriteLine(" IE File Renamed!!");
                }
                Console.WriteLine("The Extent Report is generated in ie folder.");
                break;

            default:
                htmlReporter = new ExtentV3HtmlReporter(@"C:\Users\Ashrith\source\repos\SeleniumFramwork\SeleniumFramwork\Reports\parallel\index.html");
                break;
            }

            if (browser == "chrome")
            {
                extent1.AttachReporter(htmlReporter);
            }
            else if (browser == "ie")
            {
                extent2.AttachReporter(htmlReporter);
            }


            //  extent.AttachReporter(htmlReporter);
            //  extent.Flush();



            Console.WriteLine("The Extent Report is generated." + browser);
        }
コード例 #17
0
        public static void InitializeReport()
        {
            _extent = new AventStack.ExtentReports.ExtentReports();
            var htmlReporter = new ExtentV3HtmlReporter($"{_reportingPath}\\BTAMReport {DateTime.Now.ToString("dd-MMM-yyyy hh.mm.ss")}.html");

            htmlReporter.Config.Theme = AventStack.ExtentReports.Reporter.Configuration.Theme.Dark;
            _extent.AttachReporter(htmlReporter);

            Directory.CreateDirectory(_screenshotsPath);
        }
コード例 #18
0
 public void ReportSetUp(ExtentV3HtmlReporter htmlReporter, ExtentReports extent)
 {
     htmlReporter.Config.Theme         = AventStack.ExtentReports.Reporter.Configuration.Theme.Dark;
     htmlReporter.Config.DocumentTitle = "LinkedIn Summary Report";
     extent.AttachReporter(htmlReporter);
     extent.AddSystemInfo("Project: ", "LinkedIn Internal Project");
     extent.AddSystemInfo("Web Version: ", "QA");
     extent.AddSystemInfo("Version", "v1.0");
     extent.AddSystemInfo("Browser", "Chrome");
 }
コード例 #19
0
 public static void CreateReport()
 {
     if (EXTENT_REPORT == null)
     {
         //var htmlReporter = new ExtentHtmlReporter(fullReportFilePath);//report com 3 html's
         var htmlReporter = new ExtentV3HtmlReporter(fullReportFilePath);//report unificado no html's
         EXTENT_REPORT = new AventStack.ExtentReports.ExtentReports();
         EXTENT_REPORT.AttachReporter(htmlReporter);
     }
 }
コード例 #20
0
        public void BuildReportWithoutTests()
        {
            var fileName = TestContext.CurrentContext.Test.Name + ".html";
            var reporter = new ExtentV3HtmlReporter(fileName);
            var extent   = new ExtentReports();

            extent.AttachReporter(reporter);
            extent.Flush();
            Assert.False(File.Exists(fileName));
        }
コード例 #21
0
 public static void CreateReport()
 {
     if (EXTENT_REPORT == null)
     {
         Uteis.VerificaDiretorio(reportRootPath);
         Uteis.VerificaDiretorio(reportPath);
         var htmlReporter = new ExtentV3HtmlReporter(fullReportFilePath);
         EXTENT_REPORT = new ExtentReports();
         EXTENT_REPORT.AttachReporter(htmlReporter);
     }
 }
コード例 #22
0
        public void ExtentStart()
        {
            DateTime now   = DateTime.UtcNow;
            string   nowOn = now.ToString();

            Console.WriteLine(nowOn);
            extent = new ExtentReports();
            var htmlReprot = new ExtentV3HtmlReporter(htmlReporter + nowOn + ".html");

            extent.AttachReporter(htmlReprot);
        }
コード例 #23
0
 //public void fnReportSetUp(ExtentHtmlReporter phtmlReporter, ExtentReports pExtent)
 public void fnReportSetUp(ExtentV3HtmlReporter phtmlReporter, ExtentReports pExtent)
 {
     phtmlReporter.Config.Theme         = AventStack.ExtentReports.Reporter.Configuration.Theme.Dark;
     phtmlReporter.Config.DocumentTitle = "Automation Framework Report";
     pExtent.AttachReporter(phtmlReporter);
     pExtent.AddSystemInfo("Project Name:", "Automation Framework");
     pExtent.AddSystemInfo("Application:", "LinkedIn");
     pExtent.AddSystemInfo("Environment:", "QAA");
     pExtent.AddSystemInfo("Browser:", ConfigurationManager.AppSettings.Get("browser"));
     pExtent.AddSystemInfo("Date:", time.ToShortDateString());
     pExtent.AddSystemInfo("Version:", "v1.0");
 }
コード例 #24
0
        public static void CreateReport()
        {
            if (EXTENT_REPORT == null)
            {
                GeneralHelpers.EnsureDirectoryExists(reportRootPath);
                GeneralHelpers.EnsureDirectoryExists(reportPath);

                var htmlReporter = new ExtentV3HtmlReporter(fullReportFilePath);
                EXTENT_REPORT = new ExtentReports();
                EXTENT_REPORT.AttachReporter(htmlReporter);
            }
        }
コード例 #25
0
        static ExtentService()
        {
            var    currentDirectory = new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory);
            string projectDirectory = currentDirectory.Parent.Parent.Parent.FullName;

            var reporter = new ExtentV3HtmlReporter(projectDirectory + "\\report" + "\\3Extent.html");

            reporter.Config.Theme         = Theme.Dark;
            reporter.Config.DocumentTitle = "Extent/nUnit Samples";
            reporter.Config.ReportName    = "Extent/nUnit Samples";
            Instance.AttachReporter(reporter);
        }
コード例 #26
0
        public static void ConfigureReport()
        {
            if (extent == null)
            {
                GeneralHelpers.EnsureDirectoryExists(reportRootPath);
                GeneralHelpers.EnsureDirectoryExists(reportPath);
                var reporter = new ExtentV3HtmlReporter(fullReportFilePath);

                extent = new ExtentReports();

                extent.AttachReporter(reporter);
            }
        }
コード例 #27
0
        public static void Setup()
        {
            if (htmlReporter == null)
            {
                htmlReporter = new ExtentV3HtmlReporter(rm.ReportPath());
            }

            if (extent == null)
            {
                extent = new ExtentReports();
                rm.ReportSetUp(htmlReporter, extent);
            }
        }
コード例 #28
0
        public void extentStart()
        {
            string reportPath = TestSettings.Default.ReportFilePath + "\\" + DateTime.Now.ToString("ddMMyyyy") + "\\Report";

            if (!Directory.Exists(reportPath))
            {
                Directory.CreateDirectory(reportPath);
            }
            reportPath += "\\report.html";
            var htmlReporter = new ExtentV3HtmlReporter(reportPath);

            extent.AttachReporter(htmlReporter);
        }
コード例 #29
0
        public static void CreateReport()
        {
            if (EXTENT_REPORT == null)
            {
                GeneralHelpers.EnsureDirectoryExists(reportRootPath);
                GeneralHelpers.EnsureDirectoryExists(reportPath);

                var htmlReporter = new ExtentV3HtmlReporter(fullReportFilePath);
                htmlReporter.LoadConfig(GeneralHelpers.GetProjectPath() + "extent-config.xml");
                EXTENT_REPORT = new ExtentReports();
                EXTENT_REPORT.AttachReporter(htmlReporter);
            }
        }
コード例 #30
0
 public ExtentReportsHelper()
 {
     extent   = new ExtentReports();
     reporter = new ExtentV3HtmlReporter(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "ExtentReports.html"));
     reporter.Config.DocumentTitle = "Automation Test Report";
     reporter.Config.ReportName    = "Regression Testing";
     reporter.Config.Theme         = AventStack.ExtentReports.Reporter.Configuration.Theme.Standard;
     extent.AttachReporter(reporter);
     extent.AddSystemInfo("Application Under Test", "NSNCareers Login App");
     extent.AddSystemInfo("Environment", "QA");
     extent.AddSystemInfo("Machine", Environment.MachineName);
     extent.AddSystemInfo("OS", Environment.OSVersion.VersionString);
 }