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

OSOE-906: Use WCAG 2.2 as the default accessibility standard #411

Merged
merged 3 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions Lombiq.Tests.UI.Samples/Tests/AccessibilityTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ public Task FrontendPagesShouldBeAccessible() =>
// With this config, accessibility rules will be checked for each page automatically.
configuration.AccessibilityCheckingConfiguration.RunAccessibilityCheckingAssertionOnAllPageChanges = true;

// We'll check for the WCAG 2.1 AA level. This is the middle level of the latest accessibility
// We'll check for the WCAG 2.2 AA level. This is the middle level of the latest accessibility
// guidelines. The footer widget created by the Blog recipe actually has a couple of issues. For the
// sake of this sample we won't try to fix them but rather disable the corresponding rules.
configuration.AccessibilityCheckingConfiguration.AxeBuilderConfigurator += axeBuilder =>
AccessibilityCheckingConfiguration.ConfigureWcag21aa(axeBuilder)
AccessibilityCheckingConfiguration.ConfigureWcag22aa(axeBuilder)
.DisableRules("color-contrast", "link-name");
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ public class AccessibilityCheckingConfiguration
/// Gets or sets a configuration delegate for the <see cref="AxeBuilder"/> instance used for accessibility checking.
/// For more information on the various options see <see
/// href="https://troywalshprof.github.io/SeleniumAxeDotnet/#/?id=axebuilder-reference"/>. Defaults to <see
/// cref="ConfigureWcag21aa"/>.
/// cref="ConfigureWcag22aa"/>.
/// </summary>
public Action<AxeBuilder> AxeBuilderConfigurator { get; set; } = axeBuilder => ConfigureWcag21aa(axeBuilder);
public Action<AxeBuilder> AxeBuilderConfigurator { get; set; } = axeBuilder => ConfigureWcag22aa(axeBuilder);

/// <summary>
/// Gets or sets a value indicating whether to automatically run accessibility checks every time a page changes
Expand All @@ -56,6 +56,9 @@ public class AccessibilityCheckingConfiguration
public static readonly Func<AxeBuilder, AxeBuilder> ConfigureWcag21aa = axeBuilder =>
axeBuilder.WithTags("wcag2a", "wcag2aa", "wcag21a", "wcag21aa");

public static readonly Func<AxeBuilder, AxeBuilder> ConfigureWcag22aa = axeBuilder =>
axeBuilder.WithTags("wcag2a", "wcag2aa", "wcag21a", "wcag21aa", "wcag22a", "wcag22aa");

public static readonly Action<AxeResult> AssertAxeResultIsEmpty = axeResult =>
{
axeResult.Violations.AxeResultItemsShouldBeEmpty();
Expand Down