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

[Axe] Run axe across all stories #5592

Open
wants to merge 43 commits into
base: main
Choose a base branch
from
Open

Conversation

kendallgassner
Copy link
Contributor

@kendallgassner kendallgassner commented Jan 23, 2025

In follow up PR:

  • Remove old @aat tests

This PR aims to run axe ci testing on all Storybook stories. I noticed in a previous PR that we had uncaught axe violations because we have to manually add a Playwright test for each Storybook story. Because of this manual effort many of our stories do not have axe testing setup.

In addition to writing a script to run axe against all stories I made fixes to all pre-existing stories with axe failures.

Changelog

New

Changed

Removed

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

Copy link

changeset-bot bot commented Jan 23, 2025

⚠️ No Changeset found

Latest commit: e492c51

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Jan 23, 2025
Copy link
Contributor

👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks!

Copy link
Contributor

github-actions bot commented Jan 23, 2025

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 104.56 KB (0%)
packages/react/dist/browser.umd.js 104.89 KB (0%)

@kendallgassner kendallgassner added the skip changeset This change does not need a changelog label Jan 23, 2025
@@ -49,6 +50,7 @@ export const Playground: StoryObj<typeof Banner> = {

<PageLayout.Content>
<Banner
aria-label="Content level banner"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unique aria-labels!

@kendallgassner
Copy link
Contributor Author

In follow up PRs:

  • work to remove individual aat tests.
  • consider automating VRT tests.

@github-actions github-actions bot temporarily deployed to storybook-preview-5592 January 28, 2025 19:10 Inactive
@kendallgassner kendallgassner marked this pull request as ready for review January 28, 2025 20:15
@kendallgassner kendallgassner requested a review from a team as a code owner January 28, 2025 20:15
Copy link
Member

@joshblack joshblack 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 left a couple of comments 👀


const {entries} = componentsConfig

test.describe('@aat', () => {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
test.describe('@aat', () => {
test.describe('aat', () => {

I would just annotate this as aat, or remove it, since we're using the @aat tag at the test-level to filter things out currently (although we could totally change this in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My thought was to remove all @aat tests after this is merged since we don't need to generate them ourselves

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@joshblack do you feel like we need the other @Aat tests now?

Copy link
Member

Choose a reason for hiding this comment

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

@kendallgassner I totally bet we could, especially the automated/boilerplate ones.

I think it can still be helpful to have this tag since there are stories where we would like to put the component in a specific state and then run axe, ideally. Like with menus to make sure we test things when it's open and closed or if we want to use the matrix test helper to make sure we run axe against prop combinations of things.

Copy link
Contributor Author

@kendallgassner kendallgassner Jan 28, 2025

Choose a reason for hiding this comment

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

@joshblack If we keep the '@Aat' in this file, doesn't it break up the tests to run concurrently in aat-report. I assumed aat-runner 1-4 were different threads.

e2e/components/Axe.test.ts Outdated Show resolved Hide resolved
@kendallgassner
Copy link
Contributor Author

kendallgassner commented Jan 28, 2025

A legit color-contrast failure: flash banner with a link in it. I might need to add the components-flash-features--with-icon-action-dismiss story to the skip list until we can get a fix out for this.

@primer-integration
Copy link

👋 Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/359958

@TylerJDev
Copy link
Contributor

Random question; I see the flow isn't part of the workflow ci.yml anymore, and was wondering if this was intentional? Just trying to see where the tests are being ran in the CI 👀

@kendallgassner
Copy link
Contributor Author

@TylerJDev I didn't have to change the CI because @joshblack pointed out that I could use the storybook-static/index.json file to pull storybook ids ✨ . This file is generated during npx storybook build which is already run during the aat report!

The aat report will run these specific tests because of the @aat tag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm skip changeset This change does not need a changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants