I am working on accessibility testing with Playwright and @axe-core, following the instructions here. However, my webpage contains nested iframes and when scanning the page object as per the instructions, the incomplete
property of the accessibilityScanResults
object contains this:
{
id: 'frame-tested',
impact: 'critical',
tags: [Array],
description: 'Ensures <iframe> and <frame> elements contain the axe-core script',
help: 'Frames should be tested with axe-core',
helpUrl: 'https://dequeuniversity.com/rules/axe/4.9/frame-tested?application=playwright',
nodes: [Array]
}
This is the result regardless of whether I return the results of await new AxeBuilder({ page })
or await new AxeBuilder({ page }).include('#iframe-id')
The link provided under the helpUrl
property says to “Ensure iframe and frame elements contain the axe-core script” but doesn’t provide an example of how to achieve that.
How can I ensure the iframe contents are being properly scanned and assessed by axe-core?