Skip to content

Commit

Permalink
Able to mesure environmental impacts during user journey (#77)
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

---------

Co-authored-by: Huaxing YUAN <[email protected]>

---------

Co-authored-by: Huaxing YUAN <[email protected]>
  • Loading branch information
huaxing-yuan and Huaxing YUAN authored Jan 3, 2025
1 parent 4faf047 commit 9fecd14
Show file tree
Hide file tree
Showing 34 changed files with 2,147 additions and 299 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-publish-PROnly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
Get-ChildItem ./src -Recurse -File -Filter Axa*.nupkg | % {Copy-Item -Path $_.FullName -Destination "./nuget/$_"}
- name: Upload Artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: build-artifact
path: "./nuget"
Expand Down
994 changes: 994 additions & 0 deletions src/AxaFrance.AxeExtended.HtmlReport/Assets/axe-core.fr.json

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/AxaFrance.AxeExtended.HtmlReport/Assets/report.en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"overall-banner-title": "Accessibility Report: Application {{Title}}",
"overall-banner-performed-at": "Test performed at: {{TimeStamp}}"
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net48;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net48;net6.0;net8.0;net9.0</TargetFrameworks>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>disable</Nullable>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
Expand All @@ -27,7 +27,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Deque.AxeCore.Commons" Version="4.9.1" />
<PackageReference Include="Deque.AxeCore.Commons" Version="4.10.1" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net48' ">
Expand Down
5 changes: 5 additions & 0 deletions src/AxaFrance.AxeExtended.HtmlReport/AxeOverallResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ protected override int GetScore()
}
overall += impact;
}
if(overall == 0)
{
//to avoir division by zero
return 0;
}
var score = passed * 100 / overall;
Score = score;
ScoreRotation = Score * 360 / 100;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net48;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net48;net6.0;net8.0;net9.0</TargetFrameworks>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>disable</Nullable>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
Expand All @@ -19,8 +19,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Deque.AxeCore.Selenium" Version="4.9.1" />
<PackageReference Include="SkiaSharp" Version="2.88.8" />
<PackageReference Include="Deque.AxeCore.Selenium" Version="4.10.1" />
<PackageReference Include="SkiaSharp" Version="3.116.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Binary file modified src/AxaFrance.WebEngine.Doc/files/Data-HomeInsurance.xlsx
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@
<ProductName>Microsoft .NET Framework 4.7.2 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include=".NETFramework,Version=v4.8">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.8 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
Expand Down Expand Up @@ -261,6 +266,7 @@
<EmbeddedResource Include="Ribbon.resx">
<DependentUpon>Ribbon.cs</DependentUpon>
</EmbeddedResource>
<None Include="AxaFrance.WebEngine.ExcelUI_1_TemporaryKey.pfx" />
<None Include="AxaFrance.WebEngine.ExcelUI_TemporaryKey.pfx" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
Expand Down Expand Up @@ -353,10 +359,10 @@
<SignManifests>true</SignManifests>
</PropertyGroup>
<PropertyGroup>
<ManifestKeyFile>AxaFrance.WebEngine.ExcelUI_TemporaryKey.pfx</ManifestKeyFile>
<ManifestKeyFile>AxaFrance.WebEngine.ExcelUI_1_TemporaryKey.pfx</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<ManifestCertificateThumbprint>E17D56D22BE7799197DB7C86058639A0CF1A0690</ManifestCertificateThumbprint>
<ManifestCertificateThumbprint>96271E6190A8D7740CF12B1334391DEBCD78328E</ManifestCertificateThumbprint>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>false</SignAssembly>
Expand Down
37 changes: 21 additions & 16 deletions src/AxaFrance.WebEngine.ExcelUI/FrmAbout.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/AxaFrance.WebEngine.ExcelUI/FrmAbout.resx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
<data name="pictureBox1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
vgAADr4B6kKxwAAACO1JREFUeF7dm3lQlOcBhx2b/tXO1MzEptOJM5qZdNp0JmOSqrXteKWNYjQdmzGH
vAAADrwBlbxySQAACO1JREFUeF7dm3lQlOcBhx2b/tXO1MzEptOJM5qZdNp0JmOSqrXteKWNYjQdmzGH
mrTVVo1IKh6JQBCQSwXUAA2gIwhySsEj3CAgurhyeuCBgggqIPHgWJdjj1+/d3k/4ON7d/e7YCQ/5xmd
0Rne59lvL1km4TlYR18/LnV2o7jjEbLaOvCof4D+zdhv3APcN/Yiofk+NtbUYXaxDj89mYdJ/8sRUNLx
mP7rsd+4BGh+ZkTAjQbMLDovkmXxgwlQ+PARlp6rwOSMXKaoPSZ8gCJOfE5xOVNOChM2ALnU39dVMaXk
Expand Down
1 change: 1 addition & 0 deletions src/AxaFrance.WebEngine.MobileApp/AppFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Newtonsoft.Json.Linq;
using OpenQA.Selenium.Appium;
using OpenQA.Selenium.Appium.Android;
using OpenQA.Selenium.Appium.Android.Enums;
using OpenQA.Selenium.Appium.iOS;
using OpenQA.Selenium.Remote;
using System;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>net48;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net48;net6.0;net8.0;net9.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>disable</Nullable>
<ImplicitUsings>disable</ImplicitUsings>
Expand All @@ -20,9 +20,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Appium.WebDriver" Version="5.1.0" />
<PackageReference Include="Appium.WebDriver" Version="7.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Selenium.WebDriver" Version="4.23.0" />
<PackageReference Include="Selenium.WebDriver" Version="4.27.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFrameworks>net48;net6.0-windows;net8.0-windows</TargetFrameworks>
<TargetFrameworks>net48;net6.0-windows;net9.0-windows</TargetFrameworks>
<Nullable>disable</Nullable>
<UseWPF>true</UseWPF>
<AssemblyName>ReportViewer</AssemblyName>
Expand All @@ -29,6 +29,10 @@
<None Remove="XmlDark.xshd" />
</ItemGroup>

<ItemGroup>
<Compile Include="..\AxaFrance.WebEngine.Web\NetworkRequest.cs" Link="NetworkRequest.cs" />
</ItemGroup>


<ItemGroup>
<EmbeddedResource Include="XmlDark.xshd" />
Expand All @@ -37,7 +41,8 @@
<ItemGroup>
<PackageReference Include="AvalonEdit" Version="6.3.0.90" />
<PackageReference Include="Hummingbird.UI" Version="1.2.2772.2" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2651.64" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2903.40" />

</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 4 additions & 0 deletions src/AxaFrance.WebEngine.ReportViewer/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@
</Grid>

</TabItem>
<TabItem Header="Impact" x:Name="tabResourceUsages">
<DataGrid x:Name="dgImpacts" IsReadOnly="True">
</DataGrid>
</TabItem>
</TabControl>

<TabControl Grid.Column="1" Grid.Row="3" Grid.RowSpan="2" Style="{DynamicResource SecondaryTabControlStyle}">
Expand Down
15 changes: 15 additions & 0 deletions src/AxaFrance.WebEngine.ReportViewer/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
// Modified By: YUAN Huaxing, at: 2022-8-1 10:22
using AxaFrance.WebEngine.Report;
using AxaFrance.WebEngine.Web;
using Hummingbird.UI;
using ICSharpCode.AvalonEdit.Folding;
using Microsoft.Win32;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.IO.Compression;
Expand Down Expand Up @@ -167,6 +169,19 @@ private void lvTestcases_SelectionChanged(object sender, System.Windows.Controls
tabControl.SelectedIndex = 0;
}

if(tc.AttachedData.FirstOrDefault(x=>x.Name == "ResourceUsage") != null)
{
tabResourceUsages.Visibility = Visibility.Visible;
var data = tc.AttachedData.FirstOrDefault(x => x.Name == "ResourceUsage")?.Value;
string json = System.Text.Encoding.UTF8.GetString(data);
var resourceUsage = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<string, NetworkRequest>>(json);
dgImpacts.ItemsSource = resourceUsage.Values.ToArray() ;
}
else
{
tabResourceUsages.Visibility = Visibility.Collapsed;
}


}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net48;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net48;net6.0;net8.0;net9.0</TargetFrameworks>
<Nullable>disable</Nullable>
<PublishSingleFile>false</PublishSingleFile>
<SelfContained>false</SelfContained>
Expand Down Expand Up @@ -41,7 +41,7 @@

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="SkiaSharp" Version="2.88.8" />
<PackageReference Include="SkiaSharp" Version="3.116.1" />
</ItemGroup>

</Project>
11 changes: 6 additions & 5 deletions src/AxaFrance.WebEngine.Web/AxaFrance.WebEngine.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>net48;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net48;net6.0;net8.0;net9.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>disable</Nullable>
<ImplicitUsings>disable</ImplicitUsings>
Expand Down Expand Up @@ -31,12 +31,13 @@


<ItemGroup>
<PackageReference Include="Appium.WebDriver" Version="5.1.0" />
<PackageReference Include="Appium.WebDriver" Version="7.0.0" />
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Selenium.WebDriver" Version="4.23.0" />
<PackageReference Include="SkiaSharp" Version="2.88.8" />
<PackageReference Include="WebDriverManager" Version="2.17.4" />
<PackageReference Include="Selenium.Support" Version="4.27.0" />
<PackageReference Include="Selenium.WebDriver" Version="4.27.0" />
<PackageReference Include="SkiaSharp" Version="3.116.1" />
<PackageReference Include="WebDriverManager" Version="2.17.5" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading

0 comments on commit 9fecd14

Please sign in to comment.