Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] "Accessibility testing" guidance docs #14112

Closed
dbjorge opened this issue May 11, 2022 · 7 comments
Closed

[Feature] "Accessibility testing" guidance docs #14112

dbjorge opened this issue May 11, 2022 · 7 comments

Comments

@dbjorge
Copy link
Contributor

dbjorge commented May 11, 2022

My team (Accessibility Insights) would be interested in contributing an official "Accessibility testing" page to the Guides section of https://playwright.dev/docs, comparable in size/scope/structure to the existing "API testing" guides available for Python and Java.

We wanted to open this issue to build consensus on whether this would be reasonable to include among Playwright's docs and what the desired structure/placement/etc should be.

Motivation

We are hopeful that providing official, first-party guidance will make it more likely that folks might think to use Playwright to incorporate accessibility testing earlier in the development cycle.

We think that these issues are good examples demonstrating community interest for such a guide:

Using axe-core

We propose that the guidance should be based on using Deque Labs' axe-core, an industry-standard accessibility testing engine used by Accessibility Insights and Lighthouse, among many others.

axe-core itself is a testing engine which runs in the context of (each frame of) the page being scanned. Most folks using axe-core with browser automation frameworks do so via a language- and framework-specific "integration library", which encapsulates the process of using the browser automation framework to inject axe-core into each frame of the page under test, pass through any necessary configuration options, invoke it, and retrieve results back to the test context in a format suitable for writing test assertions and/or producing standalone reports.

Today, we are aware of the following major integration libraries for axe-core and Playwright:

  • (Node.js) @axe-core/playwright (src, npm): Official integration library published by Deque
  • (Node.js) axe-playwright (src, npm): Unofficial third-party integration library which predates @axe-core/playwright and has slightly more downloads as of writing
  • (Java) com.deque.html.axe-core:playwright (src, maven): Official integration library published by Deque

We are not aware of any existing integration libraries for Playwright with .NET or Python.

Proposed documentation

For those languages where officially supported integration libraries already exist (Node.js and Java), we'd like to contribute guides explaining how to use them to do accessibility testing. These would probably follow a similar structure to the existing API testing guide for Python and Java, with an outline along these lines:

  • Accessibility testing
    • Writing an accessibility test
      • Configuring Axe
      • Running an accessibility scan
      • Verifying the scan results
      • Complete example
    • Handling known issues
    • Using a test fixture
    • Exporting a report as an attachment

Similar to the API Testing guides, the proposed guides would have very similar content but would probably need a different variation written for each language to account for the use of different integration libraries in each language.

We would probably want to include a disclaimer somewhere (the bottom of the initial overview text, maybe) warning that automated accessibility testing can only catch a limited subset of accessibility issues, and that we recommend using it in combination with regular manual assessments with Accessibility Insights for Web. This is the disclaimer text we typically use.

Implementation

Our understanding is that to implement this we would:

  1. Create a PR in this repo adding the guide content as docusaurus-flavored markdown files at:
    • /docs/src/accessibility-testing-java.md
    • /docs/src/accessibility-testing-js.md
  2. Create a PR in https://github.com/microsoft/playwright.dev which adds them to the "Guides" section of the docs sidebar by following the example of chore: add selenium-grid to sidebars playwright.dev#463, updating:
    • /java/sidebars.js
    • /java/versioned_sidebars/version-1.XX-sidebars.json for the vnext version of Playwright
    • /nodejs/sidebars.js
    • /nodejs/versioned_sidebars/version-1.XX-sidebars.json
@pavelfeldman
Copy link
Member

/cc @michael-siek @Zidious

@pavelfeldman
Copy link
Member

This plan looks good to me. I would start with Node / JavaScript, and once we are happy with it, project it to the other languages. That narrows down the focus and works well for us in our core environment.

I looked at @axe-core/playwright and it looks great. There are a couple of things that could be optimized:

  • using page.addInitScript to inject axe into all the pages and frames, once and for all, in a way that it'll live through the navigations
  • there might be a more efficient way of traversing frames and glueing partial results. // @michael-siek

But those are very much implementation details and should not stand in our way of documenting and promoting it.

@pavelfeldman
Copy link
Member

Note that you don't need to change /versioned_sidebars/. You only add it into the current ("next") version and once we cut subsequent release, it'll become versioned.

@dbjorge
Copy link
Contributor Author

dbjorge commented Jun 30, 2022

Updates:

@yury-s
Copy link
Member

yury-s commented Aug 2, 2022

We are not aware of any existing integration libraries for Playwright with .NET or Python.

  • Since this issue was created, we've become aware of a new 3rd party integration library for Playwright .NET + Axe (src, nuget)

Do I understand correctly that you are also planning to provide similar documentation for .NET but not for Python (since there is no axe python bindings) or the plan is still to have the docs only for js and Java for now?

@dbjorge
Copy link
Contributor Author

dbjorge commented Sep 13, 2022

Do I understand correctly that you are also planning to provide similar documentation for .NET but not for Python (since there is no axe python bindings) or the plan is still to have the docs only for js and Java for now?

Apologies for the delay, missed the question.

  • My team is in-progress on collaborating with Deque as well as the maintainers of Selenium.Axe and Playwright.Axe to migrate those libraries to https://github.com/dequelabs/axe-core-nuget, where libraries based on those original ones will become officially-supported axe integration libraries. Once those have released, we'll update the Playwright for .NET docs with a similar Accessibility Testing page to the ones we've added for js and java.
  • My team and Deque are interested in doing something similar for Playwright for Python in the future, but we don't have any committed timeline for it right now. If/when we were able to prioritize it, it would probably look very similar to what we're currently doing for .NET, where we'd work with Deque to help contribute a new integration library under https://github.com/dequelabs and document it on https://playwright.dev/python once the library was released.

@pavelfeldman
Copy link
Member

Why was this issue closed?

Thank you for your involvement. This issue was closed due to limited engagement (upvotes/activity), lack of recent activity, and insufficient actionability. To maintain a manageable database, we prioritize issues based on these factors.

If you disagree with this closure, please open a new issue and reference this one. More support or clarity on its necessity may prompt a review. Your understanding and cooperation are appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants