Skip to main content
.NETFramework4.7.1.NETStandard2.0

.NET bindings for the axe-core accessiblity testing engine

Published
Nov 10, 2022
4y ago
Total Downloads
3.1M
3,057,367

Install

dotnet add package Deque.AxeCore.Commons --version 4.4.0-alpha.c9651f2c2284967c64d2f28e460b5181d0af5c6d
ProductVersions
.NET Standard
netstandard2.0
Other
.NETFramework4.7.1

README

Deque.AxeCore.Commons

Provides a .NET wrapper around axe-core, including a bundled copy of axe-core and .NET typings for its options and results.

Getting Started

Note: this package is still under development; these instructions won't work until we perform an initial NuGet release

Install a .NET SDK if you haven't already.

Install Deque.AxeCore.Commons and its dependencies:

dotnet add package Deque.AxeCore.Commons

Usage

This package exists primarily to help .NET tool developers integrate axe-core with different tools and test frameworks. If you are just trying to write test cases using axe-core, you probably want to use one of these instead:

AxeResult

AxeResult represents the axe-core Results Object.

AxeRunContext

AxeRunContext represents the axe-core Context Parameter.

AxeRunOptions

AxeRunOptions represents the axe-core Options Parameter.

Axe script providers

The IAxeScriptProvider interface is suitable for use as an option in an API for running an axe-core scan of a page. It specifies a single method, GetScript(), which returns a string containing JavaScript code suitable for injecting into a running page.

This library provides two IAxeScriptProvider implementations:

1. BundledAxeScriptProvider

BundledAxeScriptProvider provides a bundled copy of axe-core which is included with the library. The included version will match the major and minor version of the library, but may not match the patch version.

This script provider is suitable as a default option for users that don't wish to explicitly override the version of axe-core to use.

IAxeScriptProvider axeScriptProvider = new BundledAxeScriptProvider();
axeScriptProvider.GetScript(); // a string containing the contents of the bundled copy of axe.min.js

2. FileAxeScriptProvider

FileAxeScriptProvider is an alternate option for users that wish to provide their own separate implementation of axe-core, usually for the purposes of pinning to a specific axe-core version independently of this library's version.

new FileAxeScriptProvider("./path/to/axe.min.js");
axeScriptProvider.GetScript(); // synchronously reads the contents of file ./path/to/axe.min.js

License

This package, including its embedded copy of axe-core, is distributed under the terms of the Mozilla Public License, version 2.0.

Acknowledgements

This package builds on past work from the SeleniumAxeDotnet and PlaywrightAxeDotnet projects (see NOTICE.txt). We thank all of those projects' contributors for their work.

Changes from Previous Version

No structural changes between v4.4.0-alpha.41 and v4.4.0-alpha.c9651f2c2284967c64d2f28e460b5181d0af5c6d.

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

This version is marked prerelease. Validate its API and upgrade path before production use.Compatibility metadata lists 2 target frameworks; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.