范围报告不会为我提供报告

时间:2018-11-06 09:30:08

标签: c# selenium report qa extentreports

我正在尝试提供一种简单的质量检查方法的报告,但是代码不会为我生成任何报告,请帮忙!

namespace CasinoClubTests
{
    [TestFixture]
    public class CasinoTests
    {
        public ExtentReports extent;
        public ExtentTest test;


        [OneTimeSetUp]
        public void StartReport()
        {
            extent = new ExtentReports();
            var htmlReporter = new ExtentHtmlReporter("ReportLogin.html");
            extent.AttachReporter(htmlReporter);
        }
        [Test]
        public void OpenWebsite()
        {
            IWebDriver driver = null;
            try
            {
                test = extent.CreateTest("OpenWebsite").Info("Test Started");
                driver = new ChromeDriver();
                driver.Url = "https://www.casinoclub.com";
                driver.Manage().Window.Maximize();
                test.Log(Status.Info, "Chrome Browser Start");
                test.Log(Status.Info, "Chrome Browser Closed");
                driver.Quit();
                test.Log(Status.Pass, "Testing is done!");
            }
            catch (Exception e)
            {
                throw;
            }
        }
        [OneTimeTearDown]
        public void EndReport()
        {            
            extent.Flush();
        }



    }
}

0 个答案:

没有答案