public void CleanUpFront()
        {
            if (TestContext.CurrentTestOutcome != UnitTestOutcome.Passed)
            {
                Test.Fail(GetErrorMessage());
            }

            Extent.Flush();
            Driver.Quit();
            _webDriver.Quit();
            HtmlReporter.Stop();

            using (var sw = new StreamWriter(ExtentFileName, true))
            {
                sw.WriteLine("<style>img {border: 1px solid #ddd;border-radius: 4px;padding: 5px;width: 150px;} img:hover {box-shadow: 0 0 2px 1px rgba(0, 140, 186, 0.5);}</style><script>function OpenImage(src){ var newTab = window.open(); newTab.document.body.innerHTML = " + '"' + "<img src=" + '"' + " + src + " + '"' + ">" + '"' + ";}</script>");
                sw.Close();
            }

            Extent       = null;
            HtmlReporter = null;
            Test         = null;
            Loger        = null;
            GC.Collect();
            GC.WaitForPendingFinalizers();
            ExecuteCmd("taskkill /im chromedriver.exe /f /t");
            TestContext.AddResultFile(ExtentFileName);
        }
Esempio n. 2
0
        /// <summary>
        /// Ends this instance.
        /// </summary>
        /// <returns></returns>
        public IReporter End()
        {
            _extentReport.Flush();
            _reporter.Flush();
            _reporter.Stop();

            return(this);
        }