-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathReporter.cs
52 lines (46 loc) · 1.53 KB
/
Reporter.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using AventStack.ExtentReports;
using AventStack.ExtentReports.Reporter;
using AventStack.ExtentReports.Reporter.Configuration;
using NUnit.Framework.Internal;
namespace RestSharpDemo.Utilities
{
public static class Reporter
{
public static ExtentReports ExtentReports;
//public static ExtentReports extent;
public static ExtentHtmlReporter ExtentHtmlReporter;
public static ExtentTest TestCase;
public static void SetupExtentReport(string reportName, string docTitle, dynamic path)
{
ExtentHtmlReporter = new ExtentHtmlReporter(path);
ExtentHtmlReporter.Config.Theme = Theme.Dark;
ExtentHtmlReporter.Config.DocumentTitle = docTitle;
ExtentHtmlReporter.Config.ReportName = reportName;
ExtentReports = new ExtentReports();
ExtentReports.AttachReporter(ExtentHtmlReporter);
}
public static void CreateTest(string testName)
{
TestCase = ExtentReports.CreateTest(testName);
}
public static void LogReport(Status status, string message)
{
TestCase.Log(status, message);
}
public static void FlushReport()
{
ExtentReports.Flush();
}
public static void TestStatus(string status)
{
if (status.Equals("Pass"))
{
TestCase.Pass("Test Passed");
}
else
{
TestCase.Fail("Test is Failed");
}
}
}
}