Skip to content

Conversation

@seanpdoyle
Copy link
Contributor

Capybara Accessibility Audit integrates with Active Support's instrumentation through publishing ActiveSupport::Notifications.

audit.capybara_accessibility_audit notification

Subscribe to audit.capybara_accessibility_audit notifications emitted when an accessibility audit is automatically conducted. In addition to the metadata provided by default (like name, duration, and allocations, etc.), the payload includes additional information:

Payload Type Description
method Symbol The Capybara method that triggered the audit
options ActiveSupport::OrderedOptions The audit's configuration
test ActionDispatch::SystemTestCase The test case that triggered the audit

Note

The audit.capybara_accessibility_audit notifications are only published when
an audit is conducted automatically. No audit.capybara_accessibility_audit
notifications will be published when assert_no_accessibility_violations is
invoked directly.

@seanpdoyle seanpdoyle force-pushed the as-notifications branch 5 times, most recently from 9f95ae6 to a75ecbf Compare December 19, 2025 16:54
Capybara Accessibility Audit integrates with [Active Support's
instrumentation][] through publishing [ActiveSupport::Notifications][].

`audit.capybara_accessibility_audit` notification
---

Subscribe to `audit.capybara_accessibility_audit` notifications emitted
when an accessibility audit is automatically conducted. In addition to
the metadata provided by default (like `name`, `duration`, and
`allocations`, etc.), the `payload` includes additional information:

| Payload       | Type                               | Description |
| ------------- | ---------------------------------- | ----------- |
| method        | Symbol                             | The Capybara method that triggered the audit
| options       | [ActiveSupport::OrderedOptions][]  | The audit's configuration
| test          | [ActionDispatch::SystemTestCase][] | The test case that triggered the audit

> [!NOTE]
> The `audit.capybara_accessibility_audit` notifications are only published when
> an audit is conducted automatically. No `audit.capybara_accessibility_audit`
> notifications will be published when `assert_no_accessibility_violations` is
> invoked directly.

[Active Support's instrumentation]: https://guides.rubyonrails.org/active_support_instrumentation.html
[ActiveSupport::Notifications]: https://api.rubyonrails.org/classes/ActiveSupport/Notifications.html
[ActiveSupport::OrderedOptions]: https://api.rubyonrails.org/classes/ActiveSupport/OrderedOptions.html
[ActionDispatch::SystemTestCase]: https://api.rubyonrails.org/classes/ActionDispatch/SystemTestCase.html
@seanpdoyle seanpdoyle merged commit 9e779f4 into main Dec 19, 2025
143 of 144 checks passed
@seanpdoyle seanpdoyle deleted the as-notifications branch December 19, 2025 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants