logseq/e2e-tests/accessibility.spec.ts

16 lines
572 B
TypeScript
Raw Normal View History

2022-08-22 12:53:59 +00:00
import { test } from './fixtures'
import { createRandomPage } from './utils'
import { expect } from '@playwright/test'
import AxeBuilder from '@axe-core/playwright'
2022-08-22 12:53:59 +00:00
test('should not have any automatically detectable accessibility issues', async ({ page }) => {
2022-08-22 12:53:59 +00:00
await createRandomPage(page)
await page.waitForTimeout(2000)
const accessibilityScanResults = await new AxeBuilder({ page })
.withTags(['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa'])
.setLegacyMode()
.analyze()
2022-11-29 05:03:41 +00:00
expect(accessibilityScanResults.violations).toEqual([]);
2022-08-24 08:50:45 +00:00
})