Ejemplo n.º 1
0
        public AventStack.ExtentReports.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 AventStack.ExtentReports.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);
        }
Ejemplo n.º 2
0
 public void BeforeClass()
 {
     try
     {
         //To create report directory and add HTML report into it
         _extent = new AventStack.ExtentReports.ExtentReports();
         if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
         {
             var           dir          = AppDomain.CurrentDomain.BaseDirectory.Replace("\\bin\\Debug\\netcoreapp3.1", "");
             DirectoryInfo di           = Directory.CreateDirectory(dir + "\\Test_Execution_Reports");
             var           htmlReporter = new ExtentHtmlReporter(dir + "\\Test_Execution_Reports" + "\\Automation_Report" + ".html");
             _extent.AddSystemInfo("Environment", "TradeMe Sandbox API");
             _extent.AddSystemInfo("User Name", "Evan Wood");
             _extent.AttachReporter(htmlReporter);
         }
         else
         {
             var           dir          = AppDomain.CurrentDomain.BaseDirectory.Replace("/bin/Debug/netcoreapp3.1", "");
             DirectoryInfo di           = Directory.CreateDirectory(dir + "/Test_Execution_Reports");
             var           htmlReporter = new ExtentHtmlReporter(dir + "/Test_Execution_Reports" + "/Automation_Report" + ".html");
             _extent.AddSystemInfo("Environment", "TradeMe Sandbox API");
             _extent.AddSystemInfo("User Name", "Evan Wood");
             _extent.AttachReporter(htmlReporter);
         }
     }
     catch (Exception e)
     {
         throw (e);
     }
 }
Ejemplo n.º 3
0
        public void BeforeClass()
        {
            // create a test report directory and attach reporter
            extent = new AventStack.ExtentReports.ExtentReports();

            dir = Directory.GetCurrentDirectory().Replace("\\bin\\Debug\\net5.0", "");
            Environment.CurrentDirectory = dir;
            if (Directory.Exists(dir + "\\Test_Execution_Reports"))
            {
                App.ClearFolder(dir + "\\Test_Execution_Reports");
            }

            DirectoryInfo di           = Directory.CreateDirectory(dir + "\\Test_Execution_Reports");
            var           htmlReporter = new ExtentHtmlReporter(dir + "\\Test_Execution_Reports\\Automation_Report.html");

            extent.AttachReporter(htmlReporter);
            extent.AddSystemInfo("Application Under Test", "nop Commerce Demo");
            extent.AddSystemInfo("Environment", "QA");
            extent.AddSystemInfo("Machine", Environment.MachineName);
            extent.AddSystemInfo("OS", Environment.OSVersion.VersionString);
            htmlReporter.Config.DocumentTitle = "NHS Covid-19 Track and Trace";
            htmlReporter.Config.ReportName    = "Automation Report for NHS Track & Trace APP";
            htmlReporter.Config.Reporter.Start();
            htmlReporter.Config.Theme = Theme.Standard;
        }
Ejemplo n.º 4
0
        public static void SetupReport()
        {
            if (extent == null)
            {
                var testOutput = ApplicationSettings.ReportOutput;
                if (!Directory.Exists(testOutput))
                {
                    Directory.CreateDirectory(testOutput);
                }

                var screenshotPath = ApplicationSettings.ReportScreenshotOutput;
                if (!Directory.Exists(screenshotPath))
                {
                    Directory.CreateDirectory(screenshotPath);
                }
                else if (ApplicationSettings.ClearOldScreenshot)
                {
                    var di = new DirectoryInfo(screenshotPath);
                    foreach (var item in di.GetFiles())
                    {
                        item.Delete();
                    }
                }

                htmlReporter = new ExtentHtmlReporter(testOutput);
                htmlReporter.Config.DocumentTitle = "KolektoHuur";
                htmlReporter.Config.ReportName    = "Kolekto Test Report";

                extent = new AventStack.ExtentReports.ExtentReports();
                extent.AddSystemInfo("Kolekto Integration", ApplicationSettings.KolektoIntegration);
                extent.AddSystemInfo("Kolekto Staging", ApplicationSettings.KolektoStaging);
                extent.AttachReporter(htmlReporter);
            }
        }
Ejemplo n.º 5
0
        private void SetReportSystemInfo()
        {
            OperatingSystem OS          = Environment.OSVersion;
            string          browserName = Environment.GetEnvironmentVariable("BROWSER_TYPE");

            extent.AddSystemInfo("Operating System: ", OS.ToString());
            extent.AddSystemInfo("Browser: ", browserName);
        }
Ejemplo n.º 6
0
        public static void AttachReporter()
        {
            extent = new AventStack.ExtentReports.ExtentReports();
            var htmlReporter = new ExtentHtmlReporter(GetReportsPath());

            extent.AttachReporter(htmlReporter);
            extent.AddSystemInfo("Environment", ExecutionConfig.Environment);
            extent.AddSystemInfo("Browser/Device", ExecutionConfig.Driver);
        }
Ejemplo n.º 7
0
        public static void BeforeTestRun()
        {
            extent = new AventStack.ExtentReports.ExtentReports();
            extent.AttachReporter(ReportFactory.Default());

            extent.AddSystemInfo("User Name", System.Environment.UserName);
            extent.AddSystemInfo("Machine Name", System.Environment.MachineName.ToString());
            extent.AddSystemInfo("OS Version", System.Environment.OSVersion.VersionString);
            extent.AddSystemInfo("Logical Cores", System.Environment.ProcessorCount.ToString());
            extent.AddSystemInfo("CLR Version", System.Environment.Version.ToString());
        }
Ejemplo n.º 8
0
        static ExtentReportconfig()
        {
            ExtentReport = new AventStack.ExtentReports.ExtentReports();
            var htmlReporter = new ExtentHtmlReporter(ConstantHelpers.ReportPath);

            ExtentReport.AddSystemInfo("HostName", "SkillSwap");
            ExtentReport.AddSystemInfo("Environment", "QC");
            ExtentReport.AddSystemInfo("Username", "Pallavi");
            htmlReporter.Config.Theme = AventStack.ExtentReports.Reporter.Configuration.Theme.Dark;
            ExtentReport.AttachReporter(htmlReporter);
        }
Ejemplo n.º 9
0
 public void ExtentReportsHelper()
 {
     extent   = new AventStack.ExtentReports.ExtentReports();
     reporter = new ExtentV3HtmlReporter(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "ExtentReports.html"));
     reporter.Config.DocumentTitle = "Automation Testing Report";
     reporter.Config.ReportName    = "Regression Testing";
     reporter.Config.Theme         = AventStack.ExtentReports.Reporter.Configuration.Theme.Standard;
     extent.AttachReporter(reporter);
     extent.AddSystemInfo("Application Under Test", "nop Commerce Demo");
     extent.AddSystemInfo("Environment", "QA");
     extent.AddSystemInfo("Machine", Environment.MachineName);
     extent.AddSystemInfo("OS", Environment.OSVersion.VersionString);
 }
Ejemplo n.º 10
0
 public void OneTimeSetUp()
 {
     try
     {
         var           dir = AppDomain.CurrentDomain.BaseDirectory.Replace("\\bin\\Debug", "");
         DirectoryInfo di  = Directory.CreateDirectory(dir + "\\Test_Execution_Reports");
         htmlReporter = new ExtentHtmlReporter(dir + "\\Test_Execution_Reports" + "\\Automation_Report" + ".html");
         Reporter.AddSystemInfo("Environment", "Automation Practice");
         Reporter.AddSystemInfo("User Name", "Mina");
         Reporter.AttachReporter(htmlReporter);
     }
     catch (Exception e)
     {
         throw (e);
     }
 }
Ejemplo n.º 11
0
        public override void OnTestExecutionBegin(TestExecutor testExecutor, TestExecutionBeginArgs args)
        {
            // start reporters
            var htmlReporter = new ExtentHtmlReporter(@"C:\DevProjects\Quintity\Repos\TestFramework\Source\Quintity.TestFramework.TestListeners\Quintity.TestFramework.ListenerTests\TestResults\bob.html");

            // create ExtentReports and attach reporter(s)
            _extent = new AventStack.ExtentReports.ExtentReports();
            _extent.AttachReporter(htmlReporter);
            _extent.AddSystemInfo("sysname", "sysInfo");

            //// creates a test
            //var test = _extent.CreateTest("MyFirstTest", "Sample1 description");

            //// log(Status, details)
            //test.Log(AventStack.ExtentReports.Status.Info, "This step shows usage of log(status, details)");

            //// info(details)
            //test.Info("This step shows usage of info(details)");

            //// log with snapshot
            //test.Fail("details",
            //    MediaEntityBuilder.CreateScreenCaptureFromPath(@"c:\temp\screenshot.png").Build());

            //// test with snapshot
            //test.AddScreenCaptureFromPath(@"c:\temp\screenshot.png");

            //test = _extent.CreateTest("MySecondTest", "Sample2 description");
            //test.AssignAuthor(new string[] { "jmothers" });
            //var test2 = test.CreateNode("Bob", "FirstNode");
            //test2.CreateNode("Jim", "Nested node");
        }
Ejemplo n.º 12
0
        public void Init()
        {
            var    path       = Settings.Config["ReportPath"];
            string reportPath = !string.IsNullOrEmpty(path)
                ? path
                : Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));

            Extent   = new AventStack.ExtentReports.ExtentReports();
            Reporter = new ExtentV3HtmlReporter(Path.Combine(reportPath, "AutomationReport.html"));
            Reporter.Config.DocumentTitle = "Automation Testing Report";
            Reporter.Config.ReportName    = "Regression Testing";
            Reporter.Config.Theme         = AventStack.ExtentReports.Reporter.Configuration.Theme.Dark;
            Extent.AttachReporter(Reporter);
            Extent.AddSystemInfo("Application Under Test", "Booking");
            Extent.AddSystemInfo("Environment", "QA");
            Extent.AddSystemInfo("Machine", Environment.MachineName);
            Extent.AddSystemInfo("OS", Environment.OSVersion.VersionString);
        }
Ejemplo n.º 13
0
        public void setReports()
        {
            String driverpath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            r1     = new ExtentHtmlReporter(driverpath + "\\" + "testresults.html");
            extent = new ExtentReports();
            extent.AttachReporter(r1);
            extent.AddSystemInfo("Opering System", "Windows 10");
            ReadData.setData(driverpath);
        }
Ejemplo n.º 14
0
        public void BeforeClass()
        {
            try
            {
                //To create report directory and add HTML report into it

                _extent = new AventStack.ExtentReports.ExtentReports();
                var           dir          = AppDomain.CurrentDomain.BaseDirectory.Replace("\\bin\\Debug", "");
                DirectoryInfo di           = Directory.CreateDirectory(dir + "\\Report");
                var           htmlReporter = new ExtentHtmlReporter(dir + "\\Report" + "\\Automation_Report" + ".html");
                _extent.AddSystemInfo("Environment", " Netboost Test");
                _extent.AddSystemInfo("User Name", "Stano");
                _extent.AttachReporter(htmlReporter);
            }
            catch (Exception e)
            {
                throw (e);
            }
        }
Ejemplo n.º 15
0
        public static void BeforeClass()
        {
            try
            {
                //To create report directory and add HTML report into it

                _extent = new AventStack.ExtentReports.ExtentReports();
                var           dir          = AppDomain.CurrentDomain.BaseDirectory.Replace("\\bin\\Debug\\netcoreapp2.1", "");
                DirectoryInfo di           = Directory.CreateDirectory(dir + "\\Test_Execution_Reports");
                var           htmlReporter = new ExtentHtmlReporter(dir + "\\Test_Execution_Reports\\Automation_Report.html");
                _extent.AddSystemInfo("Environment", "Staging");
                _extent.AddSystemInfo("User Name", "Daniel Echavaria");
                _extent.AttachReporter(htmlReporter);
            }
            catch (Exception e)
            {
                throw (e);
            }
        }
Ejemplo n.º 16
0
        public static void createReport()
        {
            //Generate reports instance for all the tests
            reports = new AventStack.ExtentReports.ExtentReports();
            ExtentHtmlReporter htmlReporter = new ExtentHtmlReporter(BaseTest.directory + @"\");

            htmlReporter.Config.DocumentTitle = "Web Automation";
            htmlReporter.Config.Encoding      = "utf-8";
            reports.AttachReporter(htmlReporter);
            reports.AddSystemInfo("Author", "Masakhane Matanzima");
        }
Ejemplo n.º 17
0
        public static void BeforeTestRun()
        {
            var path = GenericHelper.CreateFolder("ResultsReport");

            path = path + @"\index.html";
            ExtentHtmlReporter htmlReporter = new ExtentHtmlReporter(path);

            htmlReporter.Config.Theme = AventStack.ExtentReports.Reporter.Configuration.Theme.Dark;
            _extent = new AventStack.ExtentReports.ExtentReports();
            _extent.AddSystemInfo("The tests are running on: ", Config.GetConfiguration().GetSection("Browser")["BrowserType"] + " Version: " + ChromeDriverVersionHelper.GetChromeBrowserVersion());
            _extent.AttachReporter(htmlReporter);
        }
Ejemplo n.º 18
0
        public static void CreateReport(string projectName, string reportFolder)
        {
            //Read variables from appsettings
            var    settings = TestHelper.GetConfig();
            string envName  = settings["AppConfiguration:Environment"];
            string userName = settings["AppConfiguration:UserName"];

            //Report folder set up
            string TimeStamp  = DateTime.Now.ToString("yyyy-MM-dd");
            string reportPath = TestHelper.GetReportFolder() + reportFolder + "\\" + projectName + "-" + TimeStamp + ".html";

            //Report configuration
            _extent = new AventStack.ExtentReports.ExtentReports();
            ExtentV3HtmlReporter htmlReporter = new ExtentV3HtmlReporter(reportPath);

            htmlReporter.Config.DocumentTitle = projectName + " - Patching test case report";
            htmlReporter.Config.ReportName    = projectName + " - Patching test case report";
            _extent.AddSystemInfo("Environment", envName);
            _extent.AddSystemInfo("User Name", userName);
            _extent.AttachReporter(htmlReporter);
        }
Ejemplo n.º 19
0
        public void StartReport()
        {
            //config report path
            if (!Directory.Exists(_projectPath))
            {
                Directory.CreateDirectory(_projectPath);
            }

            var reportPath = $@"{_projectPath}\ExtentReport.html";

            _reporter = new ExtentV3HtmlReporter(reportPath);
            _reporter.Config.DocumentTitle = Browser.AppConfig.Report.DocumentTitle;
            _reporter.Config.ReportName    = Browser.AppConfig.Report.ReportName;
            _reporter.Config.Theme         = AventStack.ExtentReports.Reporter.Configuration.Theme.Standard;

            _extent = new AventStack.ExtentReports.ExtentReports();
            _extent.AttachReporter(_reporter);

            _extent.AddSystemInfo("Environment", Browser.AppConfig.Report.Environment);
            _extent.AddSystemInfo("Machine", Environment.MachineName);
            _extent.AddSystemInfo("OS", Environment.OSVersion.VersionString);
        }
Ejemplo n.º 20
0
        public void StartTC()
        {
            String reportpath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\" + "testresults.html";

            r1     = new ExtentHtmlReporter(reportpath);
            extent = new ExtentReports();
            extent.AttachReporter(r1);
            extent.AddSystemInfo("Opering System", "Windows 10");
            setUp("Chrome");
            driver.Url = "https://gist.github.com/discover";
            String datafilepath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\" + Constants.filename;

            ReadData.setData(datafilepath);
        }
 public void StartReport()
 {
     if (ConfigurationManager.AppSettings["Reporting"].ToLower() == "false")
     {
         Debug.WriteLine("Start Report");
     }
     else
     {
         CreateReportFolder();
         _reportDateTime = string.Format("{0:ddMMMyyyy-HHmm}", DateTime.Now);
         _reportpath     = _reportFolderPath + "\\ExeReport" + _reportDateTime + ".html";
         ExtentHtmlReporter htmlReporter = new ExtentHtmlReporter(_reportpath);
         htmlReporter.LoadConfig("c:\\AutoSetup\\report-config.xml");
         //htmlReporter.Configuration().ChartVisibilityOnOpen = true;
         //htmlReporter.AppendExisting = true;
         Extent = new AventStack.ExtentReports.ExtentReports();
         Extent.AttachReporter(htmlReporter);
         Extent.AddSystemInfo("Env", ConfigurationManager.AppSettings["Environment"]);
         Extent.AddSystemInfo("URL", ConfigurationManager.AppSettings["URL"]);
         Extent.AddSystemInfo("User", ConfigurationManager.AppSettings["TesterUserName"]);
         Extent.AddSystemInfo("Browser", ConfigurationManager.AppSettings["Browser"]);
     }
 }
Ejemplo n.º 22
0
        public TestReporting()
        {
            htmlReporter = new ExtentHtmlReporter(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));

            htmlReporter.Config.Theme = Theme.Dark;

            htmlReporter.Config.DocumentTitle = "Cross Over Test Report";

            htmlReporter.Config.ReportName = "Gmail_Test_Report";

            htmlReporter.Config.JS = @"$('.brand-logo').text('').append('<img src=C:\Users\ibhat\source\repos\ibhatt089\CrossoverTestAssignment\crossover-white.png>')";

            extent = new AventStack.ExtentReports.ExtentReports();

            extent.AttachReporter(htmlReporter);

            extent.AddSystemInfo("Application Under Test", "Gmail");

            extent.AddSystemInfo("Test Environment", "Remote QA");

            extent.AddSystemInfo("Test Machine Name", Environment.MachineName);

            extent.AddSystemInfo("Operating System", Environment.OSVersion.VersionString);
        }
        public Task InitScenario()
        {
            client = new HttpClient();

            var dir = TestContext.CurrentContext.TestDirectory + "\\";

            var reporter = new ExtentHtmlReporter(dir);

            extent = new AventStack.ExtentReports.ExtentReports();
            extent.AttachReporter(reporter);
            extent.AddSystemInfo(Environment.UserName, Environment.OSVersion.ToString());

            reporter.Config.DocumentTitle = "ApiTestWithNunitAndExtentReport.Core";
            reporter.Config.Theme         = Theme.Standard;
            reporter.Config.ReportName    = "SampleTestRun";
            return(Task.CompletedTask);
        }
Ejemplo n.º 24
0
        public static AventStack.ExtentReports.ExtentReports Setup()
        {
            string css    = "img.r-img {width: 50% ;}";
            var    config = Directory.GetCurrentDirectory();

            Directory.CreateDirectory(config).CreateSubdirectory("Reports");
            _htmlReporter                      = new ExtentHtmlReporter(Path.Combine(config, "Reports", @"Report.html"));
            _htmlReporter.Config.CSS           = css;
            _htmlReporter.Config.DocumentTitle = "Test Automation Reports";
            _htmlReporter.Config.ReportName    = "Test Smoke Reports";
            _htmlReporter.Config.Theme         = AventStack.ExtentReports.Reporter.Configuration.Theme.Dark;
            _extent = new AventStack.ExtentReports.ExtentReports();
            _extent.AnalysisStrategy = AnalysisStrategy.Test;
            _extent.AddSystemInfo("os", "windows");
            _extent.AttachReporter(_htmlReporter);
            return(_extent);
        }
Ejemplo n.º 25
0
        static void Main(string[] args)
        {
            ExtentHtmlReporter r = new ExtentHtmlReporter("Extent.html");
            //r.LoadConfig("extent-config.xml");
            //r.Configuration().ChartLocation = ChartLocation.Top;

            var extent = new ExtentReports();

            extent.AttachReporter(r);
            extent.AddSystemInfo("os", "win10x64");

            Exception e;

            try
            {
                throw new InvalidOperationException("An InvalidOperationException message");
            }
            catch (Exception ex)
            {
                e = ex;
            }

            var extentTest = extent.CreateTest("ParentTest").AssignCategory("Extent");
            var node       = extentTest.CreateNode("Node1").Pass("Pass");

            extentTest.CreateNode("Node2", "description").Fail(e);
            extentTest.CreateNode("Node3", "description").Error("Error");

            // bdd

            /*
             * var extentTest = extent.CreateTest<Feature>("ParentTest").AssignCategory("Extent");
             * var node = extentTest.CreateNode<Scenario>("Node1");
             * node.CreateNode<Given>("Node2", "description").Pass("pass");
             * node.CreateNode<When>("Node3", "description").Pass("pass");
             * node.CreateNode<Then>("Node4").Fail(e);*/

            extent.Flush();
        }
Ejemplo n.º 26
0
 public void AddSystemInfo(string key, string value)
 {
     extent.AddSystemInfo(key, value);
 }
Ejemplo n.º 27
0
 public static void AfterFeature(FeatureContext featureContext)
 {
     extentReport.AddSystemInfo("Feature Description:", featureContext.FeatureInfo.Description);
     extentReport.AddSystemInfo("Browser:", _browser);
 }