From ef16e5542363b6ec9a09113a42b818afcaebd32a Mon Sep 17 00:00:00 2001 From: Huaxing YUAN Date: Wed, 24 Sep 2025 15:10:36 +0200 Subject: [PATCH] Update package versions and improve test reporting - Updated `SkiaSharp` to version `3.119.1` across multiple projects. - Updated `Newtonsoft.Json` to version `13.0.4` in several files. - Updated `Selenium.WebDriver` and `Selenium.Support` to version `4.35.0`. - Updated `System.Text.Json` to version `9.0.9` in relevant projects. - Updated `MSTest.TestAdapter` and `MSTest.TestFramework` to version `3.10.4`. - Modified report naming convention in `ClassTearDown` for clarity. - Enhanced action reporting in `SelectDrinkTest` for better tracking. - General code cleanup and organization for improved maintainability. --- .../AxaFrance.AxeExtended.Selenium.csproj | 2 +- .../AxaFrance.WebEngine.Doc.csproj | 2 +- .../AxaFrance.WebEngine.MobileApp.csproj | 6 ++--- .../AxaFrance.WebEngine.ReportViewer.csproj | 4 +-- .../AxaFrance.WebEngine.Runner.csproj | 6 ++--- .../AxaFrance.WebEngine.Web.csproj | 10 +++---- .../AxaFrance.WebEngine.csproj | 2 +- .../Samples.DataDriven.csproj | 4 +-- src/Samples.Gherkin/Samples.Gherkin.csproj | 8 +++--- .../Samples.KeywordDriven.csproj | 2 +- .../Samples.LinearScripting.csproj | 6 ++--- src/Samples.LinearScripting/UnitTest1.cs | 27 ++++++++++++++++--- src/WebEngine.Test/WebEngine.Test.csproj | 6 ++--- 13 files changed, 52 insertions(+), 33 deletions(-) diff --git a/src/AxaFrance.AxeExtended.Selenium/AxaFrance.AxeExtended.Selenium.csproj b/src/AxaFrance.AxeExtended.Selenium/AxaFrance.AxeExtended.Selenium.csproj index dcbbce6..36ad2bd 100644 --- a/src/AxaFrance.AxeExtended.Selenium/AxaFrance.AxeExtended.Selenium.csproj +++ b/src/AxaFrance.AxeExtended.Selenium/AxaFrance.AxeExtended.Selenium.csproj @@ -20,7 +20,7 @@ - + diff --git a/src/AxaFrance.WebEngine.Doc/AxaFrance.WebEngine.Doc.csproj b/src/AxaFrance.WebEngine.Doc/AxaFrance.WebEngine.Doc.csproj index fec4246..3f674a6 100644 --- a/src/AxaFrance.WebEngine.Doc/AxaFrance.WebEngine.Doc.csproj +++ b/src/AxaFrance.WebEngine.Doc/AxaFrance.WebEngine.Doc.csproj @@ -23,7 +23,7 @@ - + diff --git a/src/AxaFrance.WebEngine.MobileApp/AxaFrance.WebEngine.MobileApp.csproj b/src/AxaFrance.WebEngine.MobileApp/AxaFrance.WebEngine.MobileApp.csproj index 4d6a171..0c6c0a1 100644 --- a/src/AxaFrance.WebEngine.MobileApp/AxaFrance.WebEngine.MobileApp.csproj +++ b/src/AxaFrance.WebEngine.MobileApp/AxaFrance.WebEngine.MobileApp.csproj @@ -21,9 +21,9 @@ - - - + + + diff --git a/src/AxaFrance.WebEngine.ReportViewer/AxaFrance.WebEngine.ReportViewer.csproj b/src/AxaFrance.WebEngine.ReportViewer/AxaFrance.WebEngine.ReportViewer.csproj index 4bda0e1..30692c0 100644 --- a/src/AxaFrance.WebEngine.ReportViewer/AxaFrance.WebEngine.ReportViewer.csproj +++ b/src/AxaFrance.WebEngine.ReportViewer/AxaFrance.WebEngine.ReportViewer.csproj @@ -44,8 +44,8 @@ - - + + diff --git a/src/AxaFrance.WebEngine.Runner/AxaFrance.WebEngine.Runner.csproj b/src/AxaFrance.WebEngine.Runner/AxaFrance.WebEngine.Runner.csproj index 07ab5eb..26005a4 100644 --- a/src/AxaFrance.WebEngine.Runner/AxaFrance.WebEngine.Runner.csproj +++ b/src/AxaFrance.WebEngine.Runner/AxaFrance.WebEngine.Runner.csproj @@ -41,9 +41,9 @@ - - - + + + diff --git a/src/AxaFrance.WebEngine.Web/AxaFrance.WebEngine.Web.csproj b/src/AxaFrance.WebEngine.Web/AxaFrance.WebEngine.Web.csproj index 08e9edd..56236fd 100644 --- a/src/AxaFrance.WebEngine.Web/AxaFrance.WebEngine.Web.csproj +++ b/src/AxaFrance.WebEngine.Web/AxaFrance.WebEngine.Web.csproj @@ -20,11 +20,11 @@ - - - - - + + + + + diff --git a/src/AxaFrance.WebEngine/AxaFrance.WebEngine.csproj b/src/AxaFrance.WebEngine/AxaFrance.WebEngine.csproj index d6973e0..c35425a 100644 --- a/src/AxaFrance.WebEngine/AxaFrance.WebEngine.csproj +++ b/src/AxaFrance.WebEngine/AxaFrance.WebEngine.csproj @@ -59,7 +59,7 @@ - + diff --git a/src/Samples.DataDriven/Samples.DataDriven.csproj b/src/Samples.DataDriven/Samples.DataDriven.csproj index e5a9479..c67e9d2 100644 --- a/src/Samples.DataDriven/Samples.DataDriven.csproj +++ b/src/Samples.DataDriven/Samples.DataDriven.csproj @@ -44,8 +44,8 @@ - - + + diff --git a/src/Samples.Gherkin/Samples.Gherkin.csproj b/src/Samples.Gherkin/Samples.Gherkin.csproj index cb7b967..40394ac 100644 --- a/src/Samples.Gherkin/Samples.Gherkin.csproj +++ b/src/Samples.Gherkin/Samples.Gherkin.csproj @@ -8,12 +8,12 @@ - + - - - + + + diff --git a/src/Samples.KeywordDriven/Samples.KeywordDriven.csproj b/src/Samples.KeywordDriven/Samples.KeywordDriven.csproj index 28c1218..faf5ec7 100644 --- a/src/Samples.KeywordDriven/Samples.KeywordDriven.csproj +++ b/src/Samples.KeywordDriven/Samples.KeywordDriven.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/Samples.LinearScripting/Samples.LinearScripting.csproj b/src/Samples.LinearScripting/Samples.LinearScripting.csproj index b36e1cf..36e8116 100644 --- a/src/Samples.LinearScripting/Samples.LinearScripting.csproj +++ b/src/Samples.LinearScripting/Samples.LinearScripting.csproj @@ -10,13 +10,13 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/Samples.LinearScripting/UnitTest1.cs b/src/Samples.LinearScripting/UnitTest1.cs index 003989d..d91ba77 100644 --- a/src/Samples.LinearScripting/UnitTest1.cs +++ b/src/Samples.LinearScripting/UnitTest1.cs @@ -49,6 +49,7 @@ public void TestCleanup() UnitTestOutcome.Error => Result.CriticalError, _ => Result.None }; + testCaseReport.EndTime = DateTime.Now; //Close the driver (and browser) after each test case. driver?.Close(); @@ -60,7 +61,7 @@ public static void ClassTearDown() { //After all test cases, we will save the test suite report. testSuiteReport!.EndTime = DateTime.Now; - var reportPath = testSuiteReport.SaveAs("TestReport", "MyTestReport", false); + var reportPath = testSuiteReport.SaveAs("TestReport", "TEST-MyTestReport", false); //you can check the test report in folder bin\Debug\net8.0\TestReport of your test project. DebugLogger.WriteLine($"Test Suite Report saved at: {reportPath}"); @@ -73,22 +74,40 @@ public static void ClassTearDown() public void SelectDrinkTest() { driver!.Navigate().GoToUrl("https://axafrance.github.io/webengine-dotnet/demo/Step1.html"); - + //during the test execution, we can add some action reports to the test case report. - testCaseReport.ActionReports.Add(new ActionReport + var step1Report = new ActionReport { Name = "Navigate to Step 1 page", Result = Result.Passed, Log = "Navigated to Step 1 page successfully." - }); + }; + + testCaseReport.ActionReports.Add(step1Report); //Create a page model for the Drink Selection page. DrinkSelectionPageModel page = new DrinkSelectionPageModel(driver); page.SelectLanguage.SelectByValue("fr"); page.RadioChooseToBuy.CheckByValue("Coffee"); + var screenshot = driver!.GetScreenshot(); page.NextButton.Click(); + var actionReport = new ActionReport + { + Name = "Select language and drink", + Result = Result.Passed, + Log = "Selected French language and Coffee drink.", + }; + actionReport.Screenshots.Add(new ScreenshotReport + { + Name = "DrinkSelectionPageScreenshot", + Data = screenshot.AsByteArray, + }); + step1Report.SubActionReports.Add(actionReport); + + + testCaseReport.ActionReports.Add(new ActionReport { Name = "Select language and drink", diff --git a/src/WebEngine.Test/WebEngine.Test.csproj b/src/WebEngine.Test/WebEngine.Test.csproj index 47f3671..9ccd7a7 100644 --- a/src/WebEngine.Test/WebEngine.Test.csproj +++ b/src/WebEngine.Test/WebEngine.Test.csproj @@ -28,13 +28,13 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - +