AxeBuilder
Playwright\Accessibility\AxeBuilder
Fluent builder for configuring and running axe-core accessibility analysis.
$ composer require playwright-php/accessibility
Methods
__construct()
function __construct( private readonly PageInterface $page, )
within()
selfAnalyze only a specific part of the page.
function within(string $selector): self
exclude()
selfExclude specific elements from the analysis.
function exclude(string $selector): self
withTags()
selfRun only rules with specific tags (e.g., 'wcag2a', 'wcag21aa').
function withTags(array $tags): self
withoutRules()
selfDisable specific rules by ID.
function withoutRules(array $rules): self
analyze()
AxeResultsRun the accessibility analysis and return results.
function analyze(): AxeResults