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

docs(accessibility-testing): create accessibility testing guide for Java #16107

Closed

Conversation

JGibson2019
Copy link
Contributor

This continues the (Accessibility Insights) team's progress towards #14112, and focuses on adding a new "Accessibility testing" guide for Java.

We plan to follow a similar approach to #15154, and once we're all satisfied with the documentation changes, our team can create a PR in the Playwright.dev repo to add this to the relevant sidebar.

We tested that npm run doc passes, per the CONTRIBUTING.MD file for this repo.

@rwoll rwoll requested a review from dgozman August 1, 2022 21:29
@rwoll
Copy link
Member

rwoll commented Aug 1, 2022

Requesting review from @dgozman since he reviewed the related #15154.

/cc @debs-obrien

Copy link
Member

@yury-s yury-s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great overall, let's update the fixtures section to be more self contain instead of referring to TestFixture class which is not a part of Playwright Java at the moment.

### Example 1: Scanning an entire page

This example demonstrates how to test an entire page for automatically detectable accessibility violations. The test:
1. Imports the `com.deque.html.axe-core/playwright` package
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it: linkify the package reference?

public class HomepageTests {
@Test // 2
void shouldNotHaveAutomaticallyDetectableAccessibilityIssues() throws Exception {
Playwright playwright = Playwright.create();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: wrap it into try (Playwright playwright = Playwright.create()) { to ensure that playwright is closed after running the test.


## Using a test fixture for common axe configuration

A [`TestFixtures` class](./test-runners#running-tests-in-parallel) is a good way to share common `AxeBuilder` configuration across many tests. Some scenarios where this might be useful include:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Playwright Java currently doesn't provide standard fixtures (with page, context, browser etc objects) and the reference to the test runner section may be confusing. We may add such fixtures in the future (discussed this just today in the team meeting) but before that perhaps it's better to just recommend moving the code into a shared utility method and have the callsite pass page as an explicit argument makeAxeBuilder(page) ?

@JGibson2019
Copy link
Contributor Author

@yury-s Closing due to issues with the feature branch used in this PR. Reopening with this PR

@JGibson2019 JGibson2019 closed this Aug 3, 2022
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.

4 participants