Skip to content

Commit aa7b7f6

Browse files
committed
feat(plugin-axe): use category-based groups
1 parent 89c9bd2 commit aa7b7f6

File tree

15 files changed

+308
-246
lines changed

15 files changed

+308
-246
lines changed

e2e/plugin-axe-e2e/tests/__snapshots__/collect.e2e.test.ts.snap

Lines changed: 128 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -670,10 +670,6 @@ exports[`PLUGIN collect report with axe-plugin NPM package > should run plugin o
670670
"groups": [
671671
{
672672
"refs": [
673-
{
674-
"slug": "area-alt",
675-
"weight": 1,
676-
},
677673
{
678674
"slug": "aria-allowed-attr",
679675
"weight": 1,
@@ -698,10 +694,6 @@ exports[`PLUGIN collect report with axe-plugin NPM package > should run plugin o
698694
"slug": "aria-hidden-body",
699695
"weight": 1,
700696
},
701-
{
702-
"slug": "aria-hidden-focus",
703-
"weight": 1,
704-
},
705697
{
706698
"slug": "aria-input-field-name",
707699
"weight": 1,
@@ -754,203 +746,277 @@ exports[`PLUGIN collect report with axe-plugin NPM package > should run plugin o
754746
"slug": "aria-valid-attr",
755747
"weight": 1,
756748
},
749+
],
750+
"slug": "aria",
751+
"title": "ARIA",
752+
},
753+
{
754+
"refs": [
757755
{
758-
"slug": "audio-caption",
756+
"slug": "color-contrast",
759757
"weight": 1,
760758
},
761759
{
762-
"slug": "blink",
760+
"slug": "link-in-text-block",
763761
"weight": 1,
764762
},
763+
],
764+
"slug": "color",
765+
"title": "Color & Contrast",
766+
},
767+
{
768+
"refs": [
765769
{
766-
"slug": "button-name",
770+
"slug": "autocomplete-valid",
767771
"weight": 1,
768772
},
769773
{
770-
"slug": "bypass",
774+
"slug": "form-field-multiple-labels",
771775
"weight": 1,
772776
},
773777
{
774-
"slug": "definition-list",
778+
"slug": "label",
775779
"weight": 1,
776780
},
777781
{
778-
"slug": "dlitem",
782+
"slug": "select-name",
779783
"weight": 1,
780784
},
785+
],
786+
"slug": "forms",
787+
"title": "Forms",
788+
},
789+
{
790+
"refs": [
781791
{
782-
"slug": "document-title",
792+
"slug": "bypass",
783793
"weight": 1,
784794
},
785795
{
786-
"slug": "duplicate-id-aria",
796+
"slug": "frame-focusable-content",
787797
"weight": 1,
788798
},
789799
{
790-
"slug": "form-field-multiple-labels",
800+
"slug": "nested-interactive",
791801
"weight": 1,
792802
},
793803
{
794-
"slug": "frame-focusable-content",
804+
"slug": "scrollable-region-focusable",
795805
"weight": 1,
796806
},
807+
],
808+
"slug": "keyboard",
809+
"title": "Keyboard",
810+
},
811+
{
812+
"refs": [
797813
{
798-
"slug": "frame-title-unique",
814+
"slug": "html-has-lang",
799815
"weight": 1,
800816
},
801817
{
802-
"slug": "frame-title",
818+
"slug": "html-lang-valid",
803819
"weight": 1,
804820
},
805821
{
806-
"slug": "html-has-lang",
822+
"slug": "html-xml-lang-mismatch",
807823
"weight": 1,
808824
},
809825
{
810-
"slug": "html-lang-valid",
826+
"slug": "valid-lang",
811827
"weight": 1,
812828
},
829+
],
830+
"slug": "language",
831+
"title": "Language",
832+
},
833+
{
834+
"refs": [
813835
{
814-
"slug": "html-xml-lang-mismatch",
836+
"slug": "aria-hidden-focus",
815837
"weight": 1,
816838
},
817839
{
818-
"slug": "image-alt",
840+
"slug": "button-name",
819841
"weight": 1,
820842
},
821843
{
822844
"slug": "input-button-name",
823845
"weight": 1,
824846
},
825847
{
826-
"slug": "input-image-alt",
848+
"slug": "link-name",
827849
"weight": 1,
828850
},
829851
{
830-
"slug": "label-content-name-mismatch",
852+
"slug": "summary-name",
831853
"weight": 1,
832854
},
855+
],
856+
"slug": "name-role-value",
857+
"title": "Names & Labels",
858+
},
859+
{
860+
"refs": [
833861
{
834-
"slug": "label",
862+
"slug": "duplicate-id-aria",
835863
"weight": 1,
836864
},
837865
{
838-
"slug": "link-in-text-block",
866+
"slug": "marquee",
839867
"weight": 1,
840868
},
869+
],
870+
"slug": "parsing",
871+
"title": "Parsing",
872+
},
873+
{
874+
"refs": [
841875
{
842-
"slug": "link-name",
876+
"slug": "label-content-name-mismatch",
843877
"weight": 1,
844878
},
845879
{
846-
"slug": "list",
880+
"slug": "p-as-heading",
847881
"weight": 1,
848882
},
883+
],
884+
"slug": "semantics",
885+
"title": "Semantics",
886+
},
887+
{
888+
"refs": [
849889
{
850-
"slug": "listitem",
890+
"slug": "meta-viewport",
851891
"weight": 1,
852892
},
893+
],
894+
"slug": "sensory-and-visual-cues",
895+
"title": "Visual Cues",
896+
},
897+
{
898+
"refs": [
853899
{
854-
"slug": "marquee",
900+
"slug": "avoid-inline-spacing",
855901
"weight": 1,
856902
},
857903
{
858-
"slug": "meta-refresh",
904+
"slug": "css-orientation-lock",
859905
"weight": 1,
860906
},
861907
{
862-
"slug": "nested-interactive",
908+
"slug": "definition-list",
863909
"weight": 1,
864910
},
865911
{
866-
"slug": "no-autoplay-audio",
912+
"slug": "dlitem",
867913
"weight": 1,
868914
},
869915
{
870-
"slug": "object-alt",
916+
"slug": "list",
871917
"weight": 1,
872918
},
873919
{
874-
"slug": "p-as-heading",
920+
"slug": "listitem",
875921
"weight": 1,
876922
},
923+
],
924+
"slug": "structure",
925+
"title": "Structure",
926+
},
927+
{
928+
"refs": [
877929
{
878-
"slug": "role-img-alt",
930+
"slug": "table-fake-caption",
879931
"weight": 1,
880932
},
881933
{
882-
"slug": "scrollable-region-focusable",
934+
"slug": "td-has-header",
883935
"weight": 1,
884936
},
885937
{
886-
"slug": "select-name",
938+
"slug": "td-headers-attr",
887939
"weight": 1,
888940
},
889941
{
890-
"slug": "server-side-image-map",
942+
"slug": "th-has-data-cells",
891943
"weight": 1,
892944
},
945+
],
946+
"slug": "tables",
947+
"title": "Tables",
948+
},
949+
{
950+
"refs": [
893951
{
894-
"slug": "summary-name",
952+
"slug": "area-alt",
895953
"weight": 1,
896954
},
897955
{
898-
"slug": "svg-img-alt",
956+
"slug": "document-title",
899957
"weight": 1,
900958
},
901959
{
902-
"slug": "table-fake-caption",
960+
"slug": "frame-title-unique",
903961
"weight": 1,
904962
},
905963
{
906-
"slug": "td-has-header",
964+
"slug": "frame-title",
907965
"weight": 1,
908966
},
909967
{
910-
"slug": "td-headers-attr",
968+
"slug": "image-alt",
911969
"weight": 1,
912970
},
913971
{
914-
"slug": "th-has-data-cells",
972+
"slug": "input-image-alt",
915973
"weight": 1,
916974
},
917975
{
918-
"slug": "video-caption",
976+
"slug": "object-alt",
919977
"weight": 1,
920978
},
921-
],
922-
"slug": "wcag21-level-a",
923-
"title": "WCAG 2.1 Level A",
924-
},
925-
{
926-
"refs": [
927979
{
928-
"slug": "autocomplete-valid",
980+
"slug": "role-img-alt",
929981
"weight": 1,
930982
},
931983
{
932-
"slug": "avoid-inline-spacing",
984+
"slug": "server-side-image-map",
933985
"weight": 1,
934986
},
935987
{
936-
"slug": "color-contrast",
988+
"slug": "svg-img-alt",
937989
"weight": 1,
938990
},
939991
{
940-
"slug": "css-orientation-lock",
992+
"slug": "video-caption",
941993
"weight": 1,
942994
},
995+
],
996+
"slug": "text-alternatives",
997+
"title": "Text Alternatives",
998+
},
999+
{
1000+
"refs": [
9431001
{
944-
"slug": "meta-viewport",
1002+
"slug": "audio-caption",
9451003
"weight": 1,
9461004
},
9471005
{
948-
"slug": "valid-lang",
1006+
"slug": "blink",
1007+
"weight": 1,
1008+
},
1009+
{
1010+
"slug": "meta-refresh",
1011+
"weight": 1,
1012+
},
1013+
{
1014+
"slug": "no-autoplay-audio",
9491015
"weight": 1,
9501016
},
9511017
],
952-
"slug": "wcag21-level-aa",
953-
"title": "WCAG 2.1 Level AA",
1018+
"slug": "time-and-media",
1019+
"title": "Media",
9541020
},
9551021
],
9561022
"icon": "folder-syntax",

packages/plugin-axe/README.md

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -141,16 +141,7 @@ Available presets:
141141
142142
### Groups
143143

144-
The plugin automatically creates groups to organize audits:
145-
146-
**WCAG presets** (`wcag21aa`, `wcag22aa`):
147-
148-
- `wcag21-level-a` - WCAG 2.1 Level A audits
149-
- `wcag21-level-aa` - WCAG 2.1 Level AA audits
150-
- `wcag22-level-a` - WCAG 2.2 Level A audits (wcag22aa only)
151-
- `wcag22-level-aa` - WCAG 2.2 Level AA audits (wcag22aa only)
152-
153-
**Best practice preset** (`best-practice`):
144+
The plugin organizes audits into category groups based on axe-core's accessibility categories:
154145

155146
- `aria` - ARIA
156147
- `color` - Color & Contrast
@@ -166,10 +157,6 @@ The plugin automatically creates groups to organize audits:
166157
- `text-alternatives` - Text Alternatives
167158
- `time-and-media` - Media
168159

169-
**All preset** (`all`):
170-
171-
- Combines all WCAG groups and best practice category groups
172-
173160
Use `npx code-pushup print-config --onlyPlugins=axe` to list all audits and groups for your configuration.
174161

175162
## Resources

packages/plugin-axe/project.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"build": {},
1010
"lint": {},
1111
"unit-test": {},
12+
"int-test": {},
1213
"code-pushup": {},
1314
"code-pushup-eslint": {},
1415
"code-pushup-coverage": {},

packages/plugin-axe/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ import { axePlugin } from './lib/axe-plugin.js';
22

33
export default axePlugin;
44
export type { AxePluginOptions } from './lib/config.js';
5-
export type { AxePreset } from './lib/constants.js';
5+
export type { AxePreset } from './lib/config.js';

0 commit comments

Comments
 (0)