Skip to content

Commit 3cc21ef

Browse files
committed
Logger: refactor to include all views others than test under commons
1 parent 613ebb0 commit 3cc21ef

16 files changed

+747
-679
lines changed

ExtentReports/ExtentReports.csproj

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,9 @@
171171
<Compile Include="Utils\ResourceUtils.cs" />
172172
<Compile Include="ViewDefs\TWBSIcon.cs" />
173173
<Compile Include="ViewDefs\MaterialIcon.cs" />
174+
<EmbeddedResource Include="Views\Commons\CommonsNav.cshtml" />
175+
<EmbeddedResource Include="Views\Commons\CommonsNavRight.cshtml" />
176+
<EmbeddedResource Include="Views\Commons\CommonsHead.cshtml" />
174177
<Compile Include="Views\Commons\ICommonsMarker.cs" />
175178
<Compile Include="Views\Html\IHtml2Marker.cs" />
176179
<EmbeddedResource Include="Views\Html\Partials\Attributes.cshtml" />
@@ -189,7 +192,6 @@
189192
<Generator>ResXFileCodeGenerator</Generator>
190193
<LastGenOutput>GherkinLangs.Designer.cs</LastGenOutput>
191194
</EmbeddedResource>
192-
<EmbeddedResource Include="Views\Commons\CommonsDashboardScripts.cshtml" />
193195
<EmbeddedResource Include="Views\Commons\CommonsDashboard.cshtml" />
194196
<EmbeddedResource Include="Views\Commons\CommonsException.cshtml" />
195197
<EmbeddedResource Include="Views\Commons\CommonsInjectCss.cshtml" />
@@ -217,15 +219,7 @@
217219
<EmbeddedResource Include="Views\V3Html\V3Nav.cshtml">
218220
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
219221
</EmbeddedResource>
220-
<EmbeddedResource Include="Views\Logger\LoggerDashboard.cshtml">
221-
<SubType>Designer</SubType>
222-
</EmbeddedResource>
223-
<EmbeddedResource Include="Views\Logger\LoggerException.cshtml" />
224-
<EmbeddedResource Include="Views\Logger\LoggerTag.cshtml" />
225222
<EmbeddedResource Include="Views\Logger\LoggerTest.cshtml" />
226-
<EmbeddedResource Include="Views\Logger\Partials\LoggerHead.cshtml" />
227-
<EmbeddedResource Include="Views\Logger\Partials\LoggerNavRight.cshtml" />
228-
<EmbeddedResource Include="Views\Logger\Partials\LoggerNav.cshtml" />
229223
<EmbeddedResource Include="Views\Logger\LoggerMacro.cshtml" />
230224
<EmbeddedResource Include="Views\Commons\CommonsAttributes.cshtml" />
231225
<EmbeddedResource Include="Views\Commons\CommonsMedia.cshtml" />

ExtentReports/Reporter/ExtentLoggerReporter.cs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@ public override void Flush(ReportAggregates reportAggregates)
3232

3333
var source = RazorEngineManager.Instance.Razor.RunCompile("LoggerTest", typeof(ExtentLoggerReporter), this);
3434
File.WriteAllText(SavePath + "Index.html", source);
35-
source = RazorEngineManager.Instance.Razor.RunCompile("LoggerDashboard", typeof(ExtentLoggerReporter), this);
35+
source = RazorEngineManager.Instance.Razor.RunCompile("CommonsDashboard", typeof(ExtentLoggerReporter), this);
3636
File.WriteAllText(SavePath + "Dashboard.html", source);
3737
if (CategoryContext.Context.Count > 0)
3838
{
39-
source = RazorEngineManager.Instance.Razor.RunCompile("LoggerTag", typeof(ExtentLoggerReporter), this);
39+
source = RazorEngineManager.Instance.Razor.RunCompile("CommonsTag", typeof(ExtentLoggerReporter), this);
4040
File.WriteAllText(SavePath + "Tag.html", source);
4141
}
4242
if (ExceptionInfoContext.Context.Count > 0)
4343
{
44-
source = RazorEngineManager.Instance.Razor.RunCompile("LoggerException", typeof(ExtentLoggerReporter), this);
44+
source = RazorEngineManager.Instance.Razor.RunCompile("CommonsException", typeof(ExtentLoggerReporter), this);
4545
File.WriteAllText(SavePath + "Exception.html", source);
4646
}
4747
}
@@ -56,13 +56,7 @@ private static void AddTemplates()
5656
{
5757
string[] templates = new string[]
5858
{
59-
"LoggerDashboard",
60-
"LoggerException",
61-
"LoggerTag",
6259
"LoggerTest",
63-
"Partials.LoggerHead",
64-
"Partials.LoggerNav",
65-
"Partials.LoggerNavRight",
6660
"LoggerMacro"
6761
};
6862
TemplateLoadService.LoadTemplate<ILoggerMarker>(templates);
@@ -71,11 +65,13 @@ private static void AddTemplates()
7165
{
7266
"CommonsAttributes",
7367
"CommonsDashboard",
74-
"CommonsDashboardScripts",
7568
"CommonsException",
69+
"CommonsHead",
7670
"CommonsInjectCss",
7771
"CommonsInjectJs",
7872
"CommonsMedia",
73+
"CommonsNav",
74+
"CommonsNavRight",
7975
"CommonsRow",
8076
"CommonsTag"
8177
};

0 commit comments

Comments
 (0)