Files
logseq/e2e-tests/accessibility.spec.ts
2022-11-22 21:43:47 +08:00

20 lines
635 B
TypeScript

import { test } from './fixtures'
import { createRandomPage } from './utils'
import { expect } from '@playwright/test'
import AxeBuilder from '@axe-core/playwright'
test('should not have any automatically detectable accessibility issues', async ({ page }) => {
await createRandomPage(page)
await page.waitForTimeout(2000)
const accessibilityScanResults = await new AxeBuilder({ page })
.withTags(['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa'])
.setLegacyMode()
.analyze()
try {
expect(accessibilityScanResults.violations).toEqual([]);
} catch (e) {
console.debug(e)
}
})