Beispiel #1
0
        private ExtentHtmlReporter()
        {
            var htmlReporter =
                new AventStack.ExtentReports.Reporter.ExtentHtmlReporter(Path.Combine(Config.GetOutputDir(),
                                                                                      "extent.html"));

            htmlReporter.LoadConfig("Extent-Config.xml");
            Extent.AttachReporter(htmlReporter);
        }
Beispiel #2
0
 public static void Initializereport(TestContext context)
 {
     //Added Code
     htmlReporter = new AventStack.ExtentReports.Reporter.ExtentHtmlReporter("D:\\Automation - Doc\\Vievuautomationresult.html");
     htmlReporter.LoadConfig("Extendreport.xml");
     extent = new ExtentReports();
     extent.AddSystemInfo("Host Name", "Nandkumar");
     extent.AddSystemInfo("Environment", "QA");
     extent.AddSystemInfo("User Name", "Nandkumar");
     extent.AttachReporter(htmlReporter);
 }
        public static void BasicSetUp()
        {
            string currentDate     = DateTime.Now.ToString("dddd, dd MMMM yyyy ");
            string currentTime     = DateTime.Now.ToShortTimeString().ToString().Replace(":", ".");
            string currentDateTime = currentDate + currentTime;

            string pth         = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            string actualPath  = pth.Substring(0, pth.LastIndexOf("bin"));
            string projectPath = new Uri(actualPath).LocalPath;
            string reportPath  = projectPath + "Reports\\TestResultReport_" + currentDateTime + ".html"; // using date time for generating new report each time

            extent = new ExtentReports();
            var extentHtml = new AventStack.ExtentReports.Reporter.ExtentHtmlReporter(reportPath);

            extent.AttachReporter(extentHtml);
            extentHtml.LoadConfig(projectPath + "extent-config.xml");

            extent.AddSystemInfo("Environment", ConfigurationManager.AppSettings["Environment"]);
        }