You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Related to #21
Related to #22
Related to #30
Related to #30
Rather than immediately fail tests (like the `:raise` reporter), log the
output through a new `:log` reporter.
---
> How many I conduct a preliminary audit that comprehensively exercises
> my system test suite without failing tests that result in violations
You can configure the audit's reporting mechanism. By default, the
`config.capybara_accessibility_audit.reporter` value is set to `:raise`,
which will raise violation errors that will fail the test suite.
To log violations, rather than raise them, you can configure
`config.capybara_accessibility_audit.reporter` to `:log`:
```ruby
class MySystemTest < ApplicationSystemTestCase
self.accessibility_audit_reporter = :log
test "with overridden accessibility :log reporter" do
visit examples_path
# ...
end
end
```
---
`report.capybara_accessibility_audit` notification
---
Subscribe to `report.capybara_accessibility_audit` notifications emitted
when an accessibility audit detects violations. The `payload` includes:
| Payload | Type | Description |
| ------------- | ---------------------------------- | ----------- |
| report | [Axe::API::Results][] | The underlying axe.js [Results][] object
| options | [ActiveSupport::OrderedOptions][] | The audit's configuration
| test | [ActionDispatch::SystemTestCase][] | The test case that triggered the audit
[ActiveSupport::OrderedOptions]: https://api.rubyonrails.org/classes/ActiveSupport/OrderedOptions.html
[ActionDispatch::SystemTestCase]: https://api.rubyonrails.org/classes/ActionDispatch/SystemTestCase.html
[Axe::API::Results]: https://github.com/dequelabs/axe-core-gems/blob/v4.11.0/packages/axe-core-api/lib/axe/api/results.rb
[Results]: https://www.deque.com/axe/core-documentation/api-documentation/#results-object
> [!NOTE]
> The `report.capybara_accessibility_audit` notifications are only published when
> `config.capybara_accessibility_audit.reporter` is configured with
> `:notification` or `:log`.
0 commit comments