.NET自动化测试工具链:Selenium+NUnit+ExtentReport

  Selenium可以执行UI的交互,ExtentReport用来生成测试报告,NUnit是我熟悉的基础测试框架,当然你也可以用MSTest、Xunit来代替。Selenium、NUnit没啥好讲的,网上相关文章很多,这里主要说一下ExtentReport。参考(http://automationtesting.in/generating-extent-reports-csharp/)。

一、环境配置:

Selenium版本:3.0

ExtentReport版本:2.4.0

NUnit版本:最新即可

二、测试代码:

        var extent = new ExtentReports("file-path", true);
        var test = extent.StartTest("My First Test", "Sample description");
        test.Log(LogStatus.Info, "This step shows usage of log(logStatus, details)");
        extent.EndTest(test);
        extent.Flush()

三、生成的报告:

还有Summary的页面,不再截图展示了。多加些Tests,就能看到效果了:

原文地址:https://www.cnblogs.com/cc299/p/7428398.html