Skip to content

Add plugins#133

Merged
abdulahmad307 merged 111 commits intomainfrom
abdul/test-plugins
Mar 17, 2026
Merged

Add plugins#133
abdulahmad307 merged 111 commits intomainfrom
abdul/test-plugins

Conversation

@abdulahmad307
Copy link
Contributor

@abdulahmad307 abdulahmad307 commented Feb 18, 2026

New Context

After validating the plugins idea, we have decided to move forward with this approach.

This PR introduces the idea of 'Plugins' to the scanner. A plugin (as described in the PLUGINS doc) is a custom script that performs an accessibility test/scan. It allows teams to specify their own tests in their own repos to surface accessibility issues. These plugins can be used in combination with existing scans. For example, a team can perform interactions on a page before the axe scan runs.

There will also be built-in scans that will ship with the scanner.

Original Context

This is a very minimal proof of concept around the idea of using plugins to make additional scans and tests modular. Looking for feedback on general approach, pros/cons, etc...

this currently works with the plugins defined in the scanner repo. I'm still working on making this work with plugins defined in the workflow repo (the repo that uses the action). There might be some issues with using absolute paths with the dynamic import() feature - but i'm still testing.

I've taken @lindseywild’s reflow test and added it as a plugin for testing. the idea is each plugin lives under a new folder under the scanner-plugins folder (which lives under .github like actions). and each plugin has a primary index.js file, which we will use to interface with the plugin.

all of this is just how I've built it as a proposal - we can tweak naming/folder-structure, etc... if we feel something else makes more sense

Copy link
Contributor

@lindseywild lindseywild left a comment

Choose a reason for hiding this comment

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

Just a few small comments, otherwise looks good!

Comment on lines +51 to +52
// - this will be coming soon
// runAxeScan: () => runAxeScan({page, includeScreenshots, findings}),
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this still relevant?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤔 not in this PR. I can remove it and make an issue to capture the need. I just didn't want to lose the intention of how we want to expose the ability to do axe scans.

Comment on lines +16 to +17
// - this will be coming soon
// runAxeScan: (options: {includeScreenshots: boolean; page: playwright.Page; findings: Finding[]}) => Promise<void>
Copy link
Contributor

Choose a reason for hiding this comment

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

Still relevant?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

same answer as above

// runAxeScan: (options: {includeScreenshots: boolean; page: playwright.Page; findings: Finding[]}) => Promise<void>
}

export type Plugin = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this need to be exported? I didn't see it anywhere (but also search + find for "plugin" returned a ton of results 😅 )

Copy link
Contributor Author

Choose a reason for hiding this comment

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

uhh. things have changed since I created it, so maybe it doesnt need to be anymore. i'll double check

@@ -0,0 +1,32 @@
export default async function test({ page, addFinding, url } = {}) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this be replaced by the real reflow test once we add it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yea, once we have a real plugin, we can get rid of the test one. this is just here to have an example

solutionShort: string
solutionLong?: string
screenshotId?: string
ruleId: string
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we make this type optional? There probably won't always be a ruleId

Copy link
Contributor

@lindseywild lindseywild left a comment

Choose a reason for hiding this comment

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

Nice job!!

@abdulahmad307 abdulahmad307 merged commit db51bb5 into main Mar 17, 2026
6 checks passed
@abdulahmad307 abdulahmad307 deleted the abdul/test-plugins branch March 17, 2026 15:23
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.

6 participants