Skip to content

Conversation

@hanna-skryl
Copy link
Collaborator

  • Implement Axe accessibility plugin with Playwright integration
  • Support WCAG 2.1/2.2, best practice, and all presets
  • Add comprehensive documentation and E2E tests

Closes #1134

@nx-cloud
Copy link

nx-cloud bot commented Nov 7, 2025

View your CI Pipeline Execution ↗ for commit 6d66b16

Command Status Duration Result
nx code-pushup --nx-bail -- print-config --outp... ❌ Failed 1m 41s View ↗

☁️ Nx Cloud last updated this comment at 2025-11-08 00:37:19 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 7, 2025

Open in StackBlitz

@code-pushup/ci

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/ci@1141

@code-pushup/cli

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/cli@1141

@code-pushup/core

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/core@1141

@code-pushup/create-cli

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/create-cli@1141

@code-pushup/models

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/models@1141

@code-pushup/nx-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/nx-plugin@1141

@code-pushup/axe-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/axe-plugin@1141

@code-pushup/coverage-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/coverage-plugin@1141

@code-pushup/eslint-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/eslint-plugin@1141

@code-pushup/js-packages-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/js-packages-plugin@1141

@code-pushup/jsdocs-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/jsdocs-plugin@1141

@code-pushup/lighthouse-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/lighthouse-plugin@1141

@code-pushup/typescript-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/typescript-plugin@1141

@code-pushup/utils

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/utils@1141

@code-pushup/models-transformers

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/models-transformers@1141

commit: 6d66b16

@hanna-skryl hanna-skryl force-pushed the axe-plugin/core-functionality branch 2 times, most recently from 3680cce to e4e390f Compare November 7, 2025 22:57
@github-actions github-actions bot added the 🦾 CI/CD Continuous integration and deployment label Nov 7, 2025
@hanna-skryl hanna-skryl force-pushed the axe-plugin/core-functionality branch from e4e390f to 72fc042 Compare November 7, 2025 23:36
@github-actions github-actions bot removed the 🦾 CI/CD Continuous integration and deployment label Nov 7, 2025
@hanna-skryl hanna-skryl force-pushed the axe-plugin/core-functionality branch 2 times, most recently from c8c6dd5 to 972b3f1 Compare November 8, 2025 00:05
@hanna-skryl hanna-skryl force-pushed the axe-plugin/core-functionality branch from 972b3f1 to 6d66b16 Compare November 8, 2025 00:17
@hanna-skryl hanna-skryl marked this pull request as ready for review November 8, 2025 00:56
Copy link
Collaborator

@matejchalk matejchalk left a comment

Choose a reason for hiding this comment

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

Very good overall 👍 I have some suggestions, but nothing major. I like that you were able to reuse a lot of logic and data types from the Lighthouse plugin.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The Axe plugin fails in CI.

Running Axe accessibility checks for 1 URL(s)...
Axe execution failed for https://github.com/code-pushup/cli?tab=readme-ov-file#code-pushup-cli/: browserType.launch: Executable doesn't exist at /home/runner/.cache/ms-playwright/chromium_headless_shell-1194/chrome-linux/headless_shell
╔═════════════════════════════════════════════════════════════════════════╗
║ Looks like Playwright Test or Playwright was just installed or updated. ║
║ Please run the following command to download new browsers: ║
║ ║
║ npx playwright install ║
║ ║
║ <3 Playwright Team ║
╚═════════════════════════════════════════════════════════════════════════╝
browserType.launch: Executable doesn't exist at /home/runner/.cache/ms-playwright/chromium_headless_shell-1194/chrome-linux/headless_shell
╔═════════════════════════════════════════════════════════════════════════╗
║ Looks like Playwright Test or Playwright was just installed or updated. ║
║ Please run the following command to download new browsers: ║
║ ║
║ npx playwright install ║
║ ║
║ <3 Playwright Team ║
╚═════════════════════════════════════════════════════════════════════════╝

I'm guessing running npx playwright install beforehand will fix the error.

I wonder if it would make sense for the plugin itself to run this command. 🤔 Or should we leave it up to the user? In my limited experience with Playwright, forgetting to run playwright install is a common mistake when adding E2E tests to CI. I'm not sure if it can be done in a cache-friendly way, though. Something like my ts-patch solution from #1133 would be ideal.

@@ -0,0 +1,5 @@
import { createE2ETestConfig } from '../../testing/test-setup-config/src/index.js';

export default createE2ETestConfig('ci-e2e', {
Copy link
Collaborator

Choose a reason for hiding this comment

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

⚠️ The wrong project name is being used here.

Suggested change
export default createE2ETestConfig('ci-e2e', {
export default createE2ETestConfig('plugin-axe-e2e', {

Comment on lines +166 to +174
it('should throw for invalid URL', () => {
expect(() => pluginUrlsSchema.parse('not-a-url')).toThrow();
});

it('should throw for array with invalid URL', () => {
expect(() =>
pluginUrlsSchema.parse(['https://example.com', 'invalid']),
).toThrow();
});
Copy link
Collaborator

Choose a reason for hiding this comment

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

You could also test invalid weights and URLs in the object.

Comment on lines +44 to +46
const audit = transformRulesToAudits(
loadAxeRules('wcag21aa'),
)[0] as Audit;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Casting via non-null assertion is preferable, because it's safer (only strips null/undefined, while as T may ignore type mismatches than intended) and less verbose.

Suggested change
const audit = transformRulesToAudits(
loadAxeRules('wcag21aa'),
)[0] as Audit;
const audit = transformRulesToAudits(loadAxeRules('wcag21aa'))[0]!;


| Property | Type | Default | Description |
| -------------- | ----------- | ------------ | ----------------------------------------- |
| `preset` | `AxePreset` | `'wcag21aa'` | Accessibility ruleset preset |
Copy link
Collaborator

Choose a reason for hiding this comment

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

A link to the Preset details section would be useful here.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Axe Plugin - Core Functionality

3 participants