Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion workspaces/global-header/e2e-tests/globalHeader.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ test('Verify Global header to be visible', async ({
- link "${translations.notifications.title}":
- /url: /notifications
`);
await runAccessibilityTests(page, testInfo);
await runAccessibilityTests(page, testInfo, undefined, '#global-header');
});

test('Verify Hover texts to be visible', async () => {
Expand Down
17 changes: 13 additions & 4 deletions workspaces/global-header/e2e-tests/utils/accessibility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,20 @@ export async function runAccessibilityTests(
page: Page,
testInfo: TestInfo,
attachName = 'accessibility-scan-results.json',
include?: string,
) {
const accessibilityScanResults = await new AxeBuilder({ page })
.withTags(['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa'])
.disableRules(['nested-interactive'])
.analyze();
let builder = new AxeBuilder({ page }).withTags([
'wcag2a',
'wcag2aa',
'wcag21a',
'wcag21aa',
]);

if (include) {
builder = builder.include(include);
}

const accessibilityScanResults = await builder.analyze();

await testInfo.attach(attachName, {
body: JSON.stringify(accessibilityScanResults, null, 2),
Expand Down
Loading