Skip to content

Commit

Permalink
Production Release of Resource Usage Tracing (#79)
Browse files Browse the repository at this point in the history
* Accessibility: update to axe core 4.9

* axe report multi lang

* unit test

* Able to mesure environmental impacts during user journey (#76)

* Update build-and-publish-PROnly.yml

* Update build-develop.yml

* Accessibility: update to axe core 4.9 (#73)

* Accessibility: update to axe core 4.9
* axe report multi lang

* [mobile] throw exception when session is not open

* unit test

* Accessibility: French verison of report

* add support of some language for accessibility test.

* update unit test for multi language.

* retro PR because commited on main branch (#75)

* [Mobile] force an exception if appium session is not opened (#74)

* Accessibility: update to axe core 4.9
* Accessibility: French verison of report
* add support of some language for accessibility test.
* update unit test for multi language.

* Optimise screenshot of accessibility test (from png to webp format)

* Avoid divide by zero error when there is no pages scanned during a test.

* update dependencies:
- Appium 7.0
- Selenium 4.27
- Axe Core 4.10.1
- Add support to .NET 9.0

* Mesure ressources metrics

* display downloaded resources

* Update build-and-publish-PROnly.yml

* Resource usage tracing (#78)

* [mobile] throw exception when session is not open

* unit test

* Accessibility: French verison of report

* add support of some language for accessibility test.

* update unit test for multi language.

* retro PR because commited on main branch (#75)

* [Mobile] force an exception if appium session is not opened (#74)

* Accessibility: update to axe core 4.9
* Accessibility: French verison of report
* add support of some language for accessibility test.
* update unit test for multi language.

* Optimise screenshot of accessibility test (from png to webp format)

* Avoid divide by zero error when there is no pages scanned during a test.

* update dependencies:
- Appium 7.0
- Selenium 4.27
- Axe Core 4.10.1
- Add support to .NET 9.0

* Mesure ressources metrics

* display downloaded resources

* Update build-and-publish-PROnly.yml

* show chart report on resource usage

* improve reportviewer

* Update the layout of ReportViewer to optimize the presentation of the information

* update documentation for java api, accessibility and resource usage

* fix some problems of documentation
  • Loading branch information
huaxing-yuan committed Jan 8, 2025
1 parent ae52ff5 commit 1547fc3
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion src/AxaFrance.WebEngine.Web/TestCaseWeb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,18 @@ public override string Cleanup()
DebugLogger.WriteLine("Accessibility Test Report has been attached to the test case report.");
}
WebDriver browser = this.Context as WebDriver;
if (MeasureResourceUsage)
{
var network = browser.Manage().Network;
network.StopMonitoring();
stopwatch?.Stop();
testCaseReport.AttachedData.Add(
new AdditionalData
{
Name = "ResourceUsage",
Value = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(requestLogs))
});
}
if (browser != null)
{
try
Expand Down Expand Up @@ -95,6 +107,10 @@ public override void Initialize()
AccessibilityReportTitle = TestData.TestName;
}
if(IsAccessibilityTestEnabled)
{
MeasureResourceUsage = true;
}
if (IsAccessibilityTestEnabled)
{
reportBuilder = InitializeA11yReportBuilder();
}
Expand All @@ -110,7 +126,17 @@ public override void Initialize()
try
{
DebugLogger.WriteLine("Initializing Selenium WebDriver");
Context = BrowserFactory.GetDriver(Settings.Instance.Platform, Settings.Instance.Browser, Settings.Instance.BrowserOptions);
var driver = BrowserFactory.GetDriver(Settings.Instance.Platform, Settings.Instance.Browser, Settings.Instance.BrowserOptions);
Context = driver;
if (MeasureResourceUsage)
{
DebugLogger.WriteLine("[DEBUG] Resource Usage Measurement is enabled.");
var network = driver.Manage().Network;
network.NetworkRequestSent += NetworkRequestSent;
network.NetworkResponseReceived += NetworkRequestReceived;
network.StartMonitoring();
}

}
catch (Exception ex)
{
Expand Down

0 comments on commit 1547fc3

Please sign in to comment.