Skip to content

Commit

Permalink
Merge pull request #411 from Lombiq/issue/OSOE-906
Browse files Browse the repository at this point in the history
OSOE-906: Use WCAG 2.2 as the default accessibility standard
  • Loading branch information
sarahelsaig authored Sep 27, 2024
2 parents 68dd41a + eebfe21 commit a89265a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
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

0 comments on commit a89265a

Please sign in to comment.