Skip to content

review page a11y tests#597

Open
roseb89 wants to merge 9 commits intomainfrom
SWIS-295/review-a11y-tests
Open

review page a11y tests#597
roseb89 wants to merge 9 commits intomainfrom
SWIS-295/review-a11y-tests

Conversation

@roseb89
Copy link
Copy Markdown
Collaborator

@roseb89 roseb89 commented Mar 11, 2026

Description

Added Axe-core scan to Review page
Added tab navigation test

Tickets:

Motivation and Context

How Has This Been Tested?

npx playwright test review-a11y.spec.ts

Checklist:

  • I have updated the documentation accordingly.
  • All new and existing tests passed.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nypl-library-card-app Ready Ready Preview, Comment Mar 31, 2026 6:01pm

Request Review

@roseb89 roseb89 requested review from Toxiapo, clarissarichard, milliesavalia and russellcullen and removed request for Toxiapo March 11, 2026 15:48
Copy link
Copy Markdown
Collaborator

@Toxiapo Toxiapo 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, just that one small change.

await expect(page).toHaveURL(/.*\/review\?.*newCard=true/);
const accessibilityScanResults = await new AxeBuilder({ page })
.withTags(["wcag21aa", "wcag22aa"])
.analyze();
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
.analyze();
.analyze();
validateA11yCoverage(accessibilityScanResults);

const reviewPage = new ReviewPage(page);

await test.step("it should tab through on Personal section", async () => {
await reviewPage.stepHeading.focus();
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think the step heading would already be focused, so we can remove the focus() and keep the toBeFocused() assertions.

await page.keyboard.press("Tab");
await expect(field).toBeFocused();
}
await reviewPage.acceptTermsCheckbox.focus();
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

If we end the for loop on the checkbox, we may not need this extra focus()

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