File tree 4 files changed +90
-1
lines changed
ExtentReports/Reporter/Config
ExtentReports.Tests/Reporter
4 files changed +90
-1
lines changed Original file line number Diff line number Diff line change 1
1
using AventStack . ExtentReports . Reporter ;
2
+ using AventStack . ExtentReports . Reporter . Config ;
2
3
using NUnit . Framework ;
3
4
using System ;
4
5
using System . IO ;
@@ -135,5 +136,27 @@ public void SparkOffline()
135
136
Assert . True ( File . Exists ( "extent/" + Scripts ) ) ;
136
137
Assert . True ( File . Exists ( "extent/" + Stylesheet ) ) ;
137
138
}
139
+
140
+ [ Test ]
141
+ public void SparkXMLConfig ( )
142
+ {
143
+ var xmlConfigPath = Path . Combine ( @"..\..\..\..\" , @"config\spark-config.xml" ) ;
144
+ var spark = new ExtentSparkReporter ( "Spark.html" ) ;
145
+ spark . LoadXMLConfig ( xmlConfigPath ) ;
146
+ Assert . AreEqual ( spark . Config . Theme , Theme . Standard ) ;
147
+ Assert . AreEqual ( spark . Config . DocumentTitle , "Extent Framework" ) ;
148
+ Assert . AreEqual ( spark . Config . Protocol , Protocol . HTTPS ) ;
149
+ }
150
+
151
+ [ Test ]
152
+ public void SparkJSONConfig ( )
153
+ {
154
+ var xmlConfigPath = Path . Combine ( @"..\..\..\..\" , @"config\spark-config.json" ) ;
155
+ var spark = new ExtentSparkReporter ( "Spark.html" ) ;
156
+ spark . LoadJSONConfig ( xmlConfigPath ) ;
157
+ Assert . AreEqual ( spark . Config . Theme , Theme . Standard ) ;
158
+ Assert . AreEqual ( spark . Config . DocumentTitle , "Extent Framework" ) ;
159
+ Assert . AreEqual ( spark . Config . Protocol , Protocol . HTTPS ) ;
160
+ }
138
161
}
139
162
}
Original file line number Diff line number Diff line change 2
2
{
3
3
public enum Theme
4
4
{
5
- Standard , Dark
5
+ Standard ,
6
+ Dark
6
7
}
7
8
}
Original file line number Diff line number Diff line change
1
+ {
2
+ "theme" : " Standard" ,
3
+ "encoding" : " utf-8" ,
4
+ "protocol" : " HTTPS" ,
5
+ "timelineEnabled" : false ,
6
+ "offlineMode" : true ,
7
+ "thumbnailForBase64" : false ,
8
+ "documentTitle" : " Extent Framework" ,
9
+ "reportName" : " ExtentReports" ,
10
+ "timeStampFormat" : " MMM dd, yyyy HH:mm:ss a" ,
11
+ "js" : " " ,
12
+ "css" : " "
13
+ }
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" utf-8" ?>
2
+ <configuration >
3
+
4
+ <!-- report theme -->
5
+ <!-- Standard, Dark -->
6
+ <theme >Standard</theme >
7
+
8
+ <!-- document encoding -->
9
+ <!-- defaults to UTF-8 -->
10
+ <encoding >UTF-8</encoding >
11
+
12
+ <!-- protocol for script and stylesheets -->
13
+ <!-- defaults to https -->
14
+ <!-- HTTP, HTTPS -->
15
+ <protocol >HTTPS</protocol >
16
+
17
+ <!-- offline report -->
18
+ <timelineEnabled >true</timelineEnabled >
19
+
20
+ <!-- offline report -->
21
+ <enableOfflineMode >false</enableOfflineMode >
22
+
23
+ <!-- use thumbnails for base64 images -->
24
+ <!-- this may slowdown viewing tests -->
25
+ <thumbnailForBase64 >false</thumbnailForBase64 >
26
+
27
+ <!-- title of the document -->
28
+ <documentTitle >Extent Framework</documentTitle >
29
+
30
+ <!-- report name - displayed at top-nav -->
31
+ <reportName >Build 1</reportName >
32
+
33
+ <!-- timestamp format -->
34
+ <timeStampFormat >MMM dd, yyyy HH:mm:ss</timeStampFormat >
35
+
36
+ <!-- custom javascript -->
37
+ <scripts >
38
+ <![CDATA[
39
+ $(document).ready(function() {
40
+
41
+ });
42
+ ]]>
43
+ </scripts >
44
+
45
+ <!-- custom styles -->
46
+ <styles >
47
+ <![CDATA[
48
+
49
+ ]]>
50
+ </styles >
51
+
52
+ </configuration >
You can’t perform that action at this time.
0 commit comments