Skip to content

Commit

Permalink
Merge pull request #4004 from Ginger-Automation/Releases/Beta-Publish…
Browse files Browse the repository at this point in the history
…ed/Beta-2024.5.1

Releases/beta published/beta 2024.5.1
  • Loading branch information
Maheshkale447 authored Nov 18, 2024
2 parents f59ccca + 0459589 commit 7cb950c
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 10 deletions.
6 changes: 6 additions & 0 deletions Ginger/GingerCoreNET/GingerCoreNET.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -1201,6 +1201,9 @@
<None Update="Reports\Ginger-Web-Client\assets\sass\_fonts.scss">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Reports\Ginger-Web-Client\assets\screenshots\ScreenShot_1_1.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Reports\Ginger-Web-Client\assets\theme\theme-report.css">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down Expand Up @@ -1237,6 +1240,9 @@
<None Update="Reports\Ginger-Web-Client\main.2ad51ab896990d24.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Reports\Ginger-Web-Client\main.50dca4a1d8ae08b9.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Reports\Ginger-Web-Client\polyfills.ab6619d5cdfdf12c.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down
53 changes: 45 additions & 8 deletions Ginger/GingerCoreNET/Logger/WebReportGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,6 @@ public LiteDbRunSet RunNewHtmlReport(string reportResultsFolderPath = "", string
IoHandler.Instance.TryFolderDelete(rootFolder);
}
IoHandler.Instance.CopyFolderRec(clientAppFolderPath, ReportrootPath, true);

if(!Directory.Exists(Path.Combine(ReportrootPath, "assets", "screenshots")))
{
Directory.CreateDirectory(Path.Combine(ReportrootPath, "assets", "screenshots"));
}
}
}
catch (Exception ex)
Expand All @@ -98,9 +93,9 @@ public LiteDbRunSet RunNewHtmlReport(string reportResultsFolderPath = "", string
{
return lightDbRunSet;
}
IoHandler.Instance.DeleteFoldersData(Path.Combine(ReportrootPath, "assets", "Execution_Data"));
IoHandler.Instance.DeleteFoldersData(Path.Combine(ReportrootPath, "assets", "screenshots"));
IoHandler.Instance.DeleteFoldersData(Path.Combine(ReportrootPath, "assets", "artifacts"));

CleanReportFolders(ReportrootPath);

LiteDbManager dbManager = new LiteDbManager(new ExecutionLoggerHelper().GetLoggerDirectory(WorkSpace.Instance.Solution.LoggerConfigurations.CalculatedLoggerFolder));
lightDbRunSet = dbManager.GetLatestExecutionRunsetData(runSetGuid);
lightDbRunSet.SetAllIterationElementsRecursively(WorkSpace.Instance.SolutionRepository.GetAllRepositoryItems<HTMLReportConfiguration>().First(r => r.IsDefault).ShowAllIterationsElements);
Expand All @@ -116,6 +111,48 @@ public LiteDbRunSet RunNewHtmlReport(string reportResultsFolderPath = "", string
return lightDbRunSet;
}

/// <summary>
/// Cleans the report folders by deleting data in specified subdirectories.
/// If the directories do not exist, they are created.
/// </summary>
/// <param name="ReportrootPath">The root path of the report folders.</param>
private static void CleanReportFolders(string ReportrootPath)
{
try
{
try
{
IoHandler.Instance.DeleteFoldersData(Path.Combine(ReportrootPath, "assets", "Execution_Data"));
}
catch (DirectoryNotFoundException)
{
Directory.CreateDirectory(Path.Combine(ReportrootPath, "assets", "Execution_Data"));
}

try
{
IoHandler.Instance.DeleteFoldersData(Path.Combine(ReportrootPath, "assets", "screenshots"));
}
catch (DirectoryNotFoundException)
{
Directory.CreateDirectory(Path.Combine(ReportrootPath, "assets", "screenshots"));
}

try
{
IoHandler.Instance.DeleteFoldersData(Path.Combine(ReportrootPath, "assets", "artifacts"));
}
catch (DirectoryNotFoundException)
{
Directory.CreateDirectory(Path.Combine(ReportrootPath, "assets", "artifacts"));
}
}
catch (Exception ex)
{
Reporter.ToLog(eLogLevel.ERROR, "Error while cleaning up reports folder", ex);
}
}

private void RemoveSkippedItems(LiteDbRunSet liteDbRunSet)
{
HTMLReportConfiguration _HTMLReportConfig = WorkSpace.Instance.SolutionRepository.GetAllRepositoryItems<HTMLReportConfiguration>().FirstOrDefault(x => (x.IsDefault == true));
Expand Down
2 changes: 1 addition & 1 deletion Ginger/GingerCoreNET/Reports/Ginger-Web-Client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@
<div class="splash-screen-bars"></div>
</div>
</app-root>
<script src="runtime.72529e3751757ee6.js"></script><script src="polyfills.ab6619d5cdfdf12c.js"></script><script src="scripts.be6ecf7cc5d670a5.js"></script><script src="main.2ad51ab896990d24.js"></script></body>
<script src="runtime.72529e3751757ee6.js"></script><script src="polyfills.ab6619d5cdfdf12c.js"></script><script src="scripts.be6ecf7cc5d670a5.js"></script><script src="main.50dca4a1d8ae08b9.js"></script></body>
</html>

This file was deleted.

Large diffs are not rendered by default.

0 comments on commit 7cb950c

Please sign in to comment.