Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(playwright): remove html reporting support #44

Merged
merged 5 commits into from
Sep 6, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions packages/playwright/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,15 +197,6 @@ axeResults = await page.RunAxe(context, options);
axeResults = await locator.RunAxe(options);


```

It is also possible to create a html report of a run.

```cs

AxeHtmlReportOptions reportOptions = new(reportDir: "C:\myReport");
AxeResults axeResults = await page.RunAxe(reportOptions: reportOptions);

```

## Contributing
Expand Down
12 changes: 0 additions & 12 deletions packages/playwright/src/AxeContent/DefaultAxeContentProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,6 @@ public sealed class DefaultAxeContentProvider : IAxeContentProvider
/// <inheritdoc />
public string GetAxeCoreScriptContent() => GetFileContents("axe.js");

/// <inheritdoc />
public IDictionary<string, string> GetHtmlReportFiles()
{
IList<string> reportStaticFiles = new List<string>()
{
"index.html",
"index.report.js"
};

return reportStaticFiles.ToDictionary(sf => sf, sf => GetFileContents(sf));
}

private string GetFileContents(string filename)
{
Stream resourceStream = Assembly
Expand Down
5 changes: 0 additions & 5 deletions packages/playwright/src/AxeContent/IAxeContentProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,5 @@ public interface IAxeContentProvider
/// Retrieves the Axe Core library file content.
/// </summary>
public string GetAxeCoreScriptContent();

/// <summary>
/// Retrieves the static files for creating the Html Report.
/// </summary>
public IDictionary<string, string> GetHtmlReportFiles();
}
}
30 changes: 0 additions & 30 deletions packages/playwright/src/AxeHtmlReportOptions.cs

This file was deleted.

48 changes: 17 additions & 31 deletions packages/playwright/src/Deque.AxeCore.Playwright.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<Project>
<Sdk Name="Microsoft.NET.Sdk" />
<Sdk Name="Yarn.MSBuild" Version="1.22.17" />
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Authors>Deque</Authors>
Expand Down Expand Up @@ -28,34 +26,7 @@
<None Include="../../../LICENSE-Deque.AxeCore.Playwright.txt" Pack="true" PackagePath="LICENSE.txt"/>
<None Include="../../../NOTICE.txt" Pack="true" PackagePath="NOTICE.txt"/>
</ItemGroup>

<Target Name="InstallClientDependencies" BeforeTargets="BeforeBuild">
<Yarn Command="install" WorkingDirectory="NodeDependencies" />
<CallTarget Targets="BuildClientDependencies" />
</Target>

<Target Name="BuildClientDependencies">
<Yarn Command="build" WorkingDirectory="NodeDependencies" />
<CallTarget Targets="IncludeClientContent" />
</Target>

<Target Name="IncludeClientContent">
<ItemGroup>
<EmbeddedResource Include="NodeDependencies/dist/index.axe-core.js" Link="axe.js">
</EmbeddedResource>
<EmbeddedResource Include="NodeDependencies/dist/index.report.js" Link="index.report.js">
</EmbeddedResource>
<EmbeddedResource Include="NodeDependencies/dist/index.html" Link="index.html">
</EmbeddedResource>
</ItemGroup>
</Target>

<ItemGroup>
<Compile Remove="NodeDependencies/**" />
<EmbeddedResource Remove="NodeDependencies/**" />
<None Remove="NodeDependencies/**" />
</ItemGroup>


<ItemGroup>
<PackageReference Include="Microsoft.Playwright" Version="1.20.2" />
<PackageReference Include="System.IO.Abstractions" Version="17.0.24" />
Expand All @@ -64,4 +35,19 @@
<ItemGroup>
<ProjectReference Include="../../commons/src/Deque.AxeCore.Commons.csproj" />
</ItemGroup>

<!--
Running this using BeforeTagets="Restore" doesn't work if we run "dotnet restore" from solution folder.
Running it before CollectPackageReferences, will work in both vs & command line. But, this task will be executed in both build & restore multiple times on multi-target project.
So, skipping this task if the copied package-lock.json file is same as the source file, to support incremental builds.
-->
<Target Name="DownloadAxe" Inputs="package-lock.json" Outputs="node_modules\package-lock.json" BeforeTargets="CollectPackageReferences">
<Exec Command="npm ci" />
<!-- Copying this file to support incremental builds -->
<Copy SourceFiles="package-lock.json" DestinationFolder="node_modules" />
</Target>

<ItemGroup>
<EmbeddedResource Include="node_modules\axe-core\axe.min.js" Link="axe.js" />
</ItemGroup>
</Project>
75 changes: 0 additions & 75 deletions packages/playwright/src/HtmlReport/HtmlReportBuilder.cs

This file was deleted.

19 changes: 0 additions & 19 deletions packages/playwright/src/HtmlReport/IHtmlReportBuilder.cs

This file was deleted.

7 changes: 0 additions & 7 deletions packages/playwright/src/NodeDependencies/.gitignore

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

14 changes: 0 additions & 14 deletions packages/playwright/src/NodeDependencies/jest.config.ts

This file was deleted.

42 changes: 0 additions & 42 deletions packages/playwright/src/NodeDependencies/package.json

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading